From 47a36fd0952d8b9a884ad7b2948a93011b4d667e Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Fri, 30 Sep 2011 17:08:35 +0000 Subject: [PATCH] Fixed Eclipse warnings --- gson/src/main/java/com/google/gson/Gson.java | 1 + .../java/com/google/gson/internal/bind/ArrayTypeAdapter.java | 2 +- .../java/com/google/gson/internal/bind/JsonElementReader.java | 2 ++ .../test/java/com/google/gson/functional/VersioningTest.java | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gson/src/main/java/com/google/gson/Gson.java b/gson/src/main/java/com/google/gson/Gson.java index a2906844..88b776c7 100644 --- a/gson/src/main/java/com/google/gson/Gson.java +++ b/gson/src/main/java/com/google/gson/Gson.java @@ -500,6 +500,7 @@ public final class Gson { * {@code writer}. * @throws JsonIOException if there was a problem writing to the writer */ + @SuppressWarnings("unchecked") public void toJson(Object src, Type typeOfSrc, JsonWriter writer) throws JsonIOException { TypeAdapter adapter = miniGson.getAdapter(TypeToken.get(typeOfSrc)); boolean oldLenient = writer.isLenient(); diff --git a/gson/src/main/java/com/google/gson/internal/bind/ArrayTypeAdapter.java b/gson/src/main/java/com/google/gson/internal/bind/ArrayTypeAdapter.java index a317026a..a53ed2c3 100644 --- a/gson/src/main/java/com/google/gson/internal/bind/ArrayTypeAdapter.java +++ b/gson/src/main/java/com/google/gson/internal/bind/ArrayTypeAdapter.java @@ -43,7 +43,7 @@ public final class ArrayTypeAdapter extends TypeAdapter { Type componentType = $Gson$Types.getArrayComponentType(type); TypeAdapter componentTypeAdapter = context.getAdapter(TypeToken.get(componentType)); - @SuppressWarnings("unchecked") // create() doesn't define a type parameter + // create() doesn't define a type parameter TypeAdapter result = new ArrayTypeAdapter( context, componentTypeAdapter, $Gson$Types.getRawType(componentType)); return result; diff --git a/gson/src/main/java/com/google/gson/internal/bind/JsonElementReader.java b/gson/src/main/java/com/google/gson/internal/bind/JsonElementReader.java index 03821971..fa56cd69 100644 --- a/gson/src/main/java/com/google/gson/internal/bind/JsonElementReader.java +++ b/gson/src/main/java/com/google/gson/internal/bind/JsonElementReader.java @@ -81,6 +81,7 @@ public final class JsonElementReader extends JsonReader { return token != JsonToken.END_OBJECT && token != JsonToken.END_ARRAY; } + @SuppressWarnings("unchecked") @Override public JsonToken peek() throws IOException { if (stack.isEmpty()) { return JsonToken.END_DOCUMENT; @@ -138,6 +139,7 @@ public final class JsonElementReader extends JsonReader { } } + @SuppressWarnings("unchecked") @Override public String nextName() throws IOException { expect(JsonToken.NAME); Iterator i = (Iterator) peekStack(); diff --git a/gson/src/test/java/com/google/gson/functional/VersioningTest.java b/gson/src/test/java/com/google/gson/functional/VersioningTest.java index 81ccf3ef..bc526de0 100644 --- a/gson/src/test/java/com/google/gson/functional/VersioningTest.java +++ b/gson/src/test/java/com/google/gson/functional/VersioningTest.java @@ -156,6 +156,7 @@ public class VersioningTest extends TestCase { @Since(1.2) private static class Version1_2 extends Version1_1 { + @SuppressWarnings("unused") int d = D; }