Fix Warnings

This commit is contained in:
Joel Leitch 2009-09-23 19:09:01 +00:00
parent b0f50bb4be
commit c6f762f36b
13 changed files with 38 additions and 38 deletions

View File

@ -54,7 +54,7 @@ public class ExposeAnnotationBasedExclusionStrategyTest extends TestCase {
@SuppressWarnings("unused")
private static class MockObject {
@Expose
public final int exposedField = 0;
public final int hiddenField = 0;
private final int exposedField = 0;
private final int hiddenField = 0;
}
}

View File

@ -56,6 +56,6 @@ public class SerializedNameAnnotationInterceptingNamingPolicyTest extends TestCa
@SuppressWarnings("unused")
private static class SomeObject {
@SerializedName(ANNOTATED_FIELD_NAME) public final int fieldWithAnnotation = 1;
public final int fieldWithoutAnnotation = 1;
private final int fieldWithoutAnnotation = 1;
}
}

View File

@ -229,25 +229,25 @@ public class TypeInfoFactoryTest extends TestCase {
TEST_1, TEST_2;
}
public String simpleField;
public TestEnum enumField;
public List<String> simpleParameterizedType;
public List<List<String>> simpleNestedParameterizedType;
public List<String>[] simpleGenericArray;
private String simpleField;
private TestEnum enumField;
private List<String> simpleParameterizedType;
private List<List<String>> simpleNestedParameterizedType;
private List<String>[] simpleGenericArray;
public T typeVariableObj;
public T[] typeVariableArray;
public T[][][] mutliDimensionalTypeVariableArray;
public List<T> listOfTypeVariables;
public List<List<T>> listOfListsOfTypeVariables;
public List<T>[] listOfTypeVariablesArray;
private T typeVariableObj;
private T[] typeVariableArray;
private T[][][] mutliDimensionalTypeVariableArray;
private List<T> listOfTypeVariables;
private List<List<T>> listOfListsOfTypeVariables;
private List<T>[] listOfTypeVariablesArray;
public List<?> listWithWildcard;
public List<?>[] arrayOfListWithWildcard;
public List<? extends String> listWithStringWildcard;
public List<? extends String>[] arrayOfListWithStringWildcard;
private List<?> listWithWildcard;
private List<?>[] arrayOfListWithWildcard;
private List<? extends String> listWithStringWildcard;
private List<? extends String>[] arrayOfListWithStringWildcard;
public List<? extends T> listWithTypeVariableWildcard;
public List<? extends T>[] arrayOfListWithTypeVariableWildcard;
private List<? extends T> listWithTypeVariableWildcard;
private List<? extends T>[] arrayOfListWithTypeVariableWildcard;
}
}

View File

@ -69,6 +69,6 @@ public class VersionExclusionStrategyTest extends TestCase {
@SuppressWarnings("unused")
@Since(VERSION)
public final int someField = 0;
private final int someField = 0;
}
}

View File

@ -285,7 +285,7 @@ public class CollectionTest extends TestCase {
// For use by Gson
@SuppressWarnings({ "unchecked", "unused" })
public ObjectWithWildcardCollection() {
private ObjectWithWildcardCollection() {
this(Collections.EMPTY_LIST);
}

View File

@ -123,9 +123,9 @@ public class ConcurrencyTest extends TestCase {
@SuppressWarnings("unused")
private static class MyObject {
String a;
String b;
int i;
private String a;
private String b;
private int i;
MyObject() {
this("hello", "world", 42);

View File

@ -170,7 +170,7 @@ public class CustomTypeAdaptersTest extends TestCase {
private static class Derived extends Base {
@SuppressWarnings("unused")
int derivedValue = 3;
private int derivedValue = 3;
}

View File

@ -76,7 +76,7 @@ public class JsonTreeTest extends TestCase {
private static class SubTypeOfBagOfPrimitives extends BagOfPrimitives {
@SuppressWarnings("unused")
float f = 1.2F;
private float f = 1.2F;
public SubTypeOfBagOfPrimitives(long l, int i, boolean b, String string, float f) {
super(l, i, b, string);
this.f = f;

View File

@ -173,7 +173,7 @@ public class MapTest extends TestCase {
private static final long serialVersionUID = 1L;
@SuppressWarnings("unused")
int foo = 10;
private int foo = 10;
}
public void testMapSubclassSerialization() {
@ -250,7 +250,7 @@ public class MapTest extends TestCase {
private static final long serialVersionUID = 1L;
@SuppressWarnings("unused")
int foo = 10;
private int foo = 10;
}
/**

View File

@ -84,8 +84,8 @@ public class NamingPolicyTest extends TestCase {
@SuppressWarnings("unused")
private static class ClassWithDuplicateFields {
public Integer a;
@SerializedName("a") public Double b;
private Integer a;
@SerializedName("a") private Double b;
public ClassWithDuplicateFields(Integer a) {
this(a, null);

View File

@ -153,9 +153,9 @@ public class NullObjectAndFieldTest extends TestCase {
@SuppressWarnings("unused")
private static class ClassWithMembers {
String str;
int[] array;
Collection<String> col;
private String str;
private int[] array;
private Collection<String> col;
}
private static class ClassWithObjectsSerializer implements JsonSerializer<ClassWithObjects> {

View File

@ -367,7 +367,7 @@ public class ObjectTest extends TestCase {
private static class ClassWithObjectField {
@SuppressWarnings("unused")
Object member;
private Object member;
}
public void testInnerClassSerialization() {
@ -393,7 +393,7 @@ public class ObjectTest extends TestCase {
private static class Parent {
@SuppressWarnings("unused")
int value1 = 1;
private int value1 = 1;
private class Child {
int value2 = 2;
}

View File

@ -466,11 +466,11 @@ public class ParameterizedTypesTest extends TestCase {
// Begin: tests to reproduce issue 103
private static class Quantity {
@SuppressWarnings("unused")
int q = 10;
private int q = 10;
}
private static class MyQuantity extends Quantity {
@SuppressWarnings("unused")
int q2 = 20;
private int q2 = 20;
}
private interface Measurable<T> {
}