Deprecate parseLenient.
It uses eval which is slow and unsafe.
Change-Id: I3de41ba0aa9a32ab43dc0e1099e461218260fc1c
diff --git a/samples/json/src/com/google/gwt/sample/json/client/JSON.java b/samples/json/src/com/google/gwt/sample/json/client/JSON.java
index 517d9e1..673f488 100644
--- a/samples/json/src/com/google/gwt/sample/json/client/JSON.java
+++ b/samples/json/src/com/google/gwt/sample/json/client/JSON.java
@@ -65,7 +65,7 @@
public void onResponseReceived(Request request, Response response) {
String responseText = response.getText();
try {
- JSONValue jsonValue = JSONParser.parse(responseText);
+ JSONValue jsonValue = JSONParser.parseStrict(responseText);
displayJSONObject(jsonValue);
} catch (JSONException e) {
displayParseError(responseText);
diff --git a/user/src/com/google/gwt/json/client/JSONParser.java b/user/src/com/google/gwt/json/client/JSONParser.java
index 4665dd3..e0d83b6 100644
--- a/user/src/com/google/gwt/json/client/JSONParser.java
+++ b/user/src/com/google/gwt/json/client/JSONParser.java
@@ -46,8 +46,7 @@
* <code>null</code>
* @throws IllegalArgumentException if <code>jsonString</code> is empty
*
- * @deprecated use {@link #parseStrict(String)} or
- * {@link #parseLenient(String)}
+ * @deprecated use {@link #parseStrict(String)}
*/
@Deprecated
public static JSONValue parse(String jsonString) {
@@ -65,7 +64,9 @@
* @throws NullPointerException if <code>jsonString</code> is
* <code>null</code>
* @throws IllegalArgumentException if <code>jsonString</code> is empty
+ * @deprecated use {@link #parseStrict(String)}
*/
+ @Deprecated
public static JSONValue parseLenient(String jsonString) {
return parse(jsonString, false);
}
@@ -211,4 +212,4 @@
*/
private JSONParser() {
}
-}
\ No newline at end of file
+}