From abf4ab2d78b2a7f3108fd7560145f45886f6b301 Mon Sep 17 00:00:00 2001 From: Joel Leitch Date: Tue, 19 May 2009 17:51:02 +0000 Subject: [PATCH] Fix project so it still compiles with JDK 1.5. --- gson/src/main/java/com/google/gson/Gson.java | 4 ++-- gson/src/test/java/com/google/gson/functional/ObjectTest.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) 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;