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") @SuppressWarnings("unused")
private static class MockObject { private static class MockObject {
@Expose @Expose
public final int exposedField = 0; private final int exposedField = 0;
public final int hiddenField = 0; private final int hiddenField = 0;
} }
} }

View File

@ -56,6 +56,6 @@ public class SerializedNameAnnotationInterceptingNamingPolicyTest extends TestCa
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static class SomeObject { private static class SomeObject {
@SerializedName(ANNOTATED_FIELD_NAME) public final int fieldWithAnnotation = 1; @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; TEST_1, TEST_2;
} }
public String simpleField; private String simpleField;
public TestEnum enumField; private TestEnum enumField;
public List<String> simpleParameterizedType; private List<String> simpleParameterizedType;
public List<List<String>> simpleNestedParameterizedType; private List<List<String>> simpleNestedParameterizedType;
public List<String>[] simpleGenericArray; private List<String>[] simpleGenericArray;
public T typeVariableObj; private T typeVariableObj;
public T[] typeVariableArray; private T[] typeVariableArray;
public T[][][] mutliDimensionalTypeVariableArray; private T[][][] mutliDimensionalTypeVariableArray;
public List<T> listOfTypeVariables; private List<T> listOfTypeVariables;
public List<List<T>> listOfListsOfTypeVariables; private List<List<T>> listOfListsOfTypeVariables;
public List<T>[] listOfTypeVariablesArray; private List<T>[] listOfTypeVariablesArray;
public List<?> listWithWildcard; private List<?> listWithWildcard;
public List<?>[] arrayOfListWithWildcard; private List<?>[] arrayOfListWithWildcard;
public List<? extends String> listWithStringWildcard; private List<? extends String> listWithStringWildcard;
public List<? extends String>[] arrayOfListWithStringWildcard; private List<? extends String>[] arrayOfListWithStringWildcard;
public List<? extends T> listWithTypeVariableWildcard; private List<? extends T> listWithTypeVariableWildcard;
public List<? extends T>[] arrayOfListWithTypeVariableWildcard; private List<? extends T>[] arrayOfListWithTypeVariableWildcard;
} }
} }

View File

@ -69,6 +69,6 @@ public class VersionExclusionStrategyTest extends TestCase {
@SuppressWarnings("unused") @SuppressWarnings("unused")
@Since(VERSION) @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 // For use by Gson
@SuppressWarnings({ "unchecked", "unused" }) @SuppressWarnings({ "unchecked", "unused" })
public ObjectWithWildcardCollection() { private ObjectWithWildcardCollection() {
this(Collections.EMPTY_LIST); this(Collections.EMPTY_LIST);
} }

View File

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

View File

@ -170,7 +170,7 @@ public class CustomTypeAdaptersTest extends TestCase {
private static class Derived extends Base { private static class Derived extends Base {
@SuppressWarnings("unused") @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 { private static class SubTypeOfBagOfPrimitives extends BagOfPrimitives {
@SuppressWarnings("unused") @SuppressWarnings("unused")
float f = 1.2F; private float f = 1.2F;
public SubTypeOfBagOfPrimitives(long l, int i, boolean b, String string, float f) { public SubTypeOfBagOfPrimitives(long l, int i, boolean b, String string, float f) {
super(l, i, b, string); super(l, i, b, string);
this.f = f; this.f = f;

View File

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

View File

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

View File

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

View File

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

View File

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