Fix Warnings
This commit is contained in:
parent
b0f50bb4be
commit
c6f762f36b
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,6 @@ public class VersionExclusionStrategyTest extends TestCase {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Since(VERSION)
|
||||
public final int someField = 0;
|
||||
private final int someField = 0;
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ public class CollectionTest extends TestCase {
|
||||
|
||||
// For use by Gson
|
||||
@SuppressWarnings({ "unchecked", "unused" })
|
||||
public ObjectWithWildcardCollection() {
|
||||
private ObjectWithWildcardCollection() {
|
||||
this(Collections.EMPTY_LIST);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -170,7 +170,7 @@ public class CustomTypeAdaptersTest extends TestCase {
|
||||
|
||||
private static class Derived extends Base {
|
||||
@SuppressWarnings("unused")
|
||||
int derivedValue = 3;
|
||||
private int derivedValue = 3;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
@ -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> {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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> {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user