Fix project so it still compiles with JDK 1.5.

This commit is contained in:
Joel Leitch 2009-05-19 17:51:02 +00:00
parent 6e59e502c2
commit abf4ab2d78
2 changed files with 2 additions and 3 deletions

View File

@ -408,10 +408,10 @@ public final class Gson {
* @throws JsonParseException if json is not a valid representation for an object of type typeOfT * @throws JsonParseException if json is not a valid representation for an object of type typeOfT
* @since 1.2 * @since 1.2
*/ */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonParseException { public <T> T fromJson(Reader json, Type typeOfT) throws JsonParseException {
JsonElement root = new JsonParser().parse(json); JsonElement root = new JsonParser().parse(json);
return fromJson(root, typeOfT); T target = fromJson(root, typeOfT);
return target;
} }
/** /**

View File

@ -19,7 +19,6 @@ package com.google.gson.functional;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator; import com.google.gson.InstanceCreator;
import com.google.gson.JsonParseException;
import com.google.gson.common.TestTypes.ArrayOfObjects; import com.google.gson.common.TestTypes.ArrayOfObjects;
import com.google.gson.common.TestTypes.BagOfPrimitiveWrappers; import com.google.gson.common.TestTypes.BagOfPrimitiveWrappers;
import com.google.gson.common.TestTypes.BagOfPrimitives; import com.google.gson.common.TestTypes.BagOfPrimitives;