From 0b4bf7706a8f997a9279ad70c656fe5bfa221df2 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Fri, 5 Nov 2010 20:31:52 +0000 Subject: [PATCH] Changed JsonParser API to throw specific JsonIOException,JsonSyntaxException instead of the general JsonParseException --- gson/src/main/java/com/google/gson/JsonParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gson/src/main/java/com/google/gson/JsonParser.java b/gson/src/main/java/com/google/gson/JsonParser.java index 7b775bdb..917c4118 100755 --- a/gson/src/main/java/com/google/gson/JsonParser.java +++ b/gson/src/main/java/com/google/gson/JsonParser.java @@ -37,7 +37,7 @@ public final class JsonParser { * @throws JsonParseException if the specified text is not valid JSON * @since 1.3 */ - public JsonElement parse(String json) throws JsonParseException { + public JsonElement parse(String json) throws JsonSyntaxException { return parse(new StringReader(json)); } @@ -49,7 +49,7 @@ public final class JsonParser { * @throws JsonParseException if the specified text is not valid JSON * @since 1.3 */ - public JsonElement parse(Reader json) throws JsonParseException { + public JsonElement parse(Reader json) throws JsonIOException, JsonSyntaxException { return parse(new JsonReader(json)); } @@ -59,7 +59,7 @@ public final class JsonParser { * @throws JsonParseException if there is an IOException or if the specified * text is not valid JSON */ - public JsonElement parse(JsonReader json) throws JsonParseException { + public JsonElement parse(JsonReader json) throws JsonIOException, JsonSyntaxException { boolean lenient = json.isLenient(); json.setLenient(true); try {