Fix project so it still compiles with JDK 1.5.
This commit is contained in:
parent
6e59e502c2
commit
abf4ab2d78
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user