diff --git a/gson/src/main/java/com/google/gson/Gson.java b/gson/src/main/java/com/google/gson/Gson.java index 61991131..e01fb247 100644 --- a/gson/src/main/java/com/google/gson/Gson.java +++ b/gson/src/main/java/com/google/gson/Gson.java @@ -408,10 +408,10 @@ public final class Gson { * @throws JsonParseException if json is not a valid representation for an object of type typeOfT * @since 1.2 */ - @SuppressWarnings("unchecked") public T fromJson(Reader json, Type typeOfT) throws JsonParseException { JsonElement root = new JsonParser().parse(json); - return fromJson(root, typeOfT); + T target = fromJson(root, typeOfT); + return target; } /** diff --git a/gson/src/test/java/com/google/gson/functional/ObjectTest.java b/gson/src/test/java/com/google/gson/functional/ObjectTest.java index 67e9c50b..06665db5 100644 --- a/gson/src/test/java/com/google/gson/functional/ObjectTest.java +++ b/gson/src/test/java/com/google/gson/functional/ObjectTest.java @@ -19,7 +19,6 @@ package com.google.gson.functional; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.InstanceCreator; -import com.google.gson.JsonParseException; import com.google.gson.common.TestTypes.ArrayOfObjects; import com.google.gson.common.TestTypes.BagOfPrimitiveWrappers; import com.google.gson.common.TestTypes.BagOfPrimitives;