Fixed Eclipse warnings
This commit is contained in:
parent
cf15565243
commit
47a36fd095
|
@ -500,6 +500,7 @@ public final class Gson {
|
||||||
* {@code writer}.
|
* {@code writer}.
|
||||||
* @throws JsonIOException if there was a problem writing to the 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 {
|
public void toJson(Object src, Type typeOfSrc, JsonWriter writer) throws JsonIOException {
|
||||||
TypeAdapter<?> adapter = miniGson.getAdapter(TypeToken.get(typeOfSrc));
|
TypeAdapter<?> adapter = miniGson.getAdapter(TypeToken.get(typeOfSrc));
|
||||||
boolean oldLenient = writer.isLenient();
|
boolean oldLenient = writer.isLenient();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public final class ArrayTypeAdapter<E> extends TypeAdapter<Object> {
|
||||||
|
|
||||||
Type componentType = $Gson$Types.getArrayComponentType(type);
|
Type componentType = $Gson$Types.getArrayComponentType(type);
|
||||||
TypeAdapter<?> componentTypeAdapter = context.getAdapter(TypeToken.get(componentType));
|
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(
|
TypeAdapter<T> result = new ArrayTypeAdapter(
|
||||||
context, componentTypeAdapter, $Gson$Types.getRawType(componentType));
|
context, componentTypeAdapter, $Gson$Types.getRawType(componentType));
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -81,6 +81,7 @@ public final class JsonElementReader extends JsonReader {
|
||||||
return token != JsonToken.END_OBJECT && token != JsonToken.END_ARRAY;
|
return token != JsonToken.END_OBJECT && token != JsonToken.END_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override public JsonToken peek() throws IOException {
|
@Override public JsonToken peek() throws IOException {
|
||||||
if (stack.isEmpty()) {
|
if (stack.isEmpty()) {
|
||||||
return JsonToken.END_DOCUMENT;
|
return JsonToken.END_DOCUMENT;
|
||||||
|
@ -138,6 +139,7 @@ public final class JsonElementReader extends JsonReader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override public String nextName() throws IOException {
|
@Override public String nextName() throws IOException {
|
||||||
expect(JsonToken.NAME);
|
expect(JsonToken.NAME);
|
||||||
Iterator<?> i = (Iterator) peekStack();
|
Iterator<?> i = (Iterator) peekStack();
|
||||||
|
|
|
@ -156,6 +156,7 @@ public class VersioningTest extends TestCase {
|
||||||
|
|
||||||
@Since(1.2)
|
@Since(1.2)
|
||||||
private static class Version1_2 extends Version1_1 {
|
private static class Version1_2 extends Version1_1 {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
int d = D;
|
int d = D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user