Fixed Eclipse warnings

This commit is contained in:
Inderjeet Singh 2011-09-30 17:08:35 +00:00
parent cf15565243
commit 47a36fd095
4 changed files with 5 additions and 1 deletions

View File

@ -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();

View File

@ -43,7 +43,7 @@ public final class ArrayTypeAdapter<E> extends TypeAdapter<Object> {
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<T> result = new ArrayTypeAdapter(
context, componentTypeAdapter, $Gson$Types.getRawType(componentType));
return result;

View File

@ -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();

View File

@ -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;
}