From 2d0898ad123ed0de0f9826c549057ec431de8ab4 Mon Sep 17 00:00:00 2001 From: "jon.chambers@gmail.com" Date: Sat, 10 Aug 2013 03:07:47 +0000 Subject: [PATCH] Marked a pair of parse methods as deprecated. --- src/main/java/org/json/simple/JSONValue.java | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/org/json/simple/JSONValue.java b/src/main/java/org/json/simple/JSONValue.java index 8cf52d2..3658cfe 100644 --- a/src/main/java/org/json/simple/JSONValue.java +++ b/src/main/java/org/json/simple/JSONValue.java @@ -36,6 +36,9 @@ public class JSONValue { * java.lang.Boolean, * null * + * @deprecated this method may throw an {@code Error} instead of returning + * {@code null}; please use {@link JSONValue#parseWithException(Reader)} + * instead */ public static Object parse(Reader in){ try{ @@ -47,6 +50,26 @@ public class JSONValue { } } + /** + * Parse JSON text into java object from the given string. + * Please use parseWithException() if you don't want to ignore the exception. + * + * @see org.json.simple.parser.JSONParser#parse(Reader) + * @see #parseWithException(Reader) + * + * @param s + * @return Instance of the following: + * org.json.simple.JSONObject, + * org.json.simple.JSONArray, + * java.lang.String, + * java.lang.Number, + * java.lang.Boolean, + * null + * + * @deprecated this method may throw an {@code Error} instead of returning + * {@code null}; please use {@link JSONValue#parseWithException(String)} + * instead + */ public static Object parse(String s){ StringReader in=new StringReader(s); return parse(in);