Fix compile issues found during release.

This commit is contained in:
Joel Leitch 2011-11-13 20:04:29 +00:00
parent 2c19c43905
commit a92cf394e8
2 changed files with 3 additions and 3 deletions

View File

@ -683,7 +683,7 @@ public final class Gson {
*/ */
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException { public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
JsonReader jsonReader = new JsonReader(json); JsonReader jsonReader = new JsonReader(json);
T object = fromJson(jsonReader, typeOfT); T object = (T) fromJson(jsonReader, typeOfT);
assertFullConsumption(object, jsonReader); assertFullConsumption(object, jsonReader);
return object; return object;
} }
@ -780,7 +780,7 @@ public final class Gson {
if (json == null) { if (json == null) {
return null; return null;
} }
return fromJson(new JsonElementReader(json), typeOfT); return (T) fromJson(new JsonElementReader(json), typeOfT);
} }
@Override @Override

View File

@ -39,7 +39,7 @@ final class GsonToMiniGsonTypeAdapterFactory implements TypeAdapter.Factory {
this.deserializationContext = new JsonDeserializationContext() { this.deserializationContext = new JsonDeserializationContext() {
public <T> T deserialize(JsonElement json, Type typeOfT) throws JsonParseException { public <T> T deserialize(JsonElement json, Type typeOfT) throws JsonParseException {
return gson.fromJson(json, typeOfT); return (T) gson.fromJson(json, typeOfT);
} }
}; };