diff --git a/gson/src/main/java/com/google/gson/Gson.java b/gson/src/main/java/com/google/gson/Gson.java index dcb4fb72..b804c2aa 100644 --- a/gson/src/main/java/com/google/gson/Gson.java +++ b/gson/src/main/java/com/google/gson/Gson.java @@ -427,16 +427,10 @@ public final class Gson { */ @SuppressWarnings("unchecked") public T fromJson(JsonElement json, Type typeOfT) throws JsonParseException { - try { - JsonDeserializationContext context = new JsonDeserializationContextDefault( - createDefaultObjectNavigatorFactory(), deserializers, objectConstructor); - T target = (T) context.deserialize(json, typeOfT); - return target; - } catch (StackOverflowError e) { - throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e); - } catch (OutOfMemoryError e) { - throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e); - } + JsonDeserializationContext context = new JsonDeserializationContextDefault( + createDefaultObjectNavigatorFactory(), deserializers, objectConstructor); + T target = (T) context.deserialize(json, typeOfT); + return target; } /**