Fix warnings
This commit is contained in:
parent
541252a9fb
commit
361292f1c1
|
@ -334,11 +334,11 @@ public final class $Gson$Types {
|
|||
}
|
||||
|
||||
public static Type resolve(Type context, Class<?> contextRawType, Type toResolve) {
|
||||
return resolve(context, contextRawType, toResolve, new HashSet<TypeVariable>());
|
||||
return resolve(context, contextRawType, toResolve, new HashSet<TypeVariable<?>>());
|
||||
}
|
||||
|
||||
private static Type resolve(Type context, Class<?> contextRawType, Type toResolve,
|
||||
Collection<TypeVariable> visitedTypeVariables) {
|
||||
Collection<TypeVariable<?>> visitedTypeVariables) {
|
||||
// this implementation is made a little more complicated in an attempt to avoid object-creation
|
||||
while (true) {
|
||||
if (toResolve instanceof TypeVariable) {
|
||||
|
|
|
@ -37,7 +37,6 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import com.google.gson.common.MoreAsserts;
|
||||
import com.google.gson.common.TestTypes.BagOfPrimitives;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
|
|
|
@ -172,6 +172,7 @@ public class TreeTypeAdaptersTest extends TestCase {
|
|||
int numClasses;
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
private static <T> List<T> createList(T ...items) {
|
||||
return Arrays.asList(items);
|
||||
}
|
||||
|
|
|
@ -280,6 +280,7 @@ public final class LinkedHashTreeMapTest extends TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
private <T> void assertIterationOrder(Iterable<T> actual, T... expected) {
|
||||
ArrayList<T> actualList = new ArrayList<T>();
|
||||
for (T t : actual) {
|
||||
|
|
|
@ -140,6 +140,7 @@ public final class LinkedTreeMapTest extends TestCase {
|
|||
MoreAsserts.assertEqualsAndHashCode(map1, map2);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
private <T> void assertIterationOrder(Iterable<T> actual, T... expected) {
|
||||
ArrayList<T> actualList = new ArrayList<T>();
|
||||
for (T t : actual) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public class RecursiveTypesResolveTest extends TestCase {
|
|||
|
||||
@SuppressWarnings("unused")
|
||||
private static class Foo1<A> {
|
||||
public Foo2<? extends A> foo2;
|
||||
public Foo2<? extends A> foo2;
|
||||
}
|
||||
@SuppressWarnings("unused")
|
||||
private static class Foo2<B> {
|
||||
|
@ -48,6 +48,7 @@ public class RecursiveTypesResolveTest extends TestCase {
|
|||
*/
|
||||
|
||||
public void testRecursiveResolveSimple() {
|
||||
@SuppressWarnings("rawtypes")
|
||||
TypeAdapter<Foo1> adapter = new Gson().getAdapter(Foo1.class);
|
||||
assertNotNull(adapter);
|
||||
}
|
||||
|
@ -62,6 +63,7 @@ public class RecursiveTypesResolveTest extends TestCase {
|
|||
}
|
||||
|
||||
public void testIssue440WeakReference() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
TypeAdapter<WeakReference> adapter = new Gson().getAdapter(WeakReference.class);
|
||||
assertNotNull(adapter);
|
||||
}
|
||||
|
@ -105,11 +107,13 @@ public class RecursiveTypesResolveTest extends TestCase {
|
|||
}
|
||||
|
||||
public void testRecursiveTypeVariablesResolve1() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
TypeAdapter<TestType> adapter = new Gson().getAdapter(TestType.class);
|
||||
assertNotNull(adapter);
|
||||
}
|
||||
|
||||
public void testRecursiveTypeVariablesResolve12() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
TypeAdapter<TestType2> adapter = new Gson().getAdapter(TestType2.class);
|
||||
assertNotNull(adapter);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user