From 005c93e3832e8f83aa5602d83ffb6d181ec0f1a1 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Wed, 23 Mar 2011 18:48:03 +0000 Subject: [PATCH] removed unused no-args constructors --- .../java/com/google/gson/common/TestTypes.java | 16 ---------------- .../google/gson/functional/CollectionTest.java | 11 ----------- .../gson/functional/CustomTypeAdaptersTest.java | 12 ------------ .../gson/functional/DefaultTypeAdaptersTest.java | 6 ------ .../google/gson/functional/ExposeFieldsTest.java | 11 ----------- .../google/gson/functional/InheritanceTest.java | 11 ----------- 6 files changed, 67 deletions(-) diff --git a/gson/src/test/java/com/google/gson/common/TestTypes.java b/gson/src/test/java/com/google/gson/common/TestTypes.java index ff52e0ab..f8e86696 100644 --- a/gson/src/test/java/com/google/gson/common/TestTypes.java +++ b/gson/src/test/java/com/google/gson/common/TestTypes.java @@ -53,10 +53,6 @@ public class TestTypes { public static class ClassWithBaseField { public static final String FIELD_KEY = "base"; public final Base base; - @SuppressWarnings("unused") - private ClassWithBaseField() { - this(null); - } public ClassWithBaseField(Base base) { this.base = base; } @@ -65,10 +61,6 @@ public class TestTypes { public static class ClassWithBaseArrayField { public static final String FIELD_KEY = "base"; public final Base[] base; - @SuppressWarnings("unused") - private ClassWithBaseArrayField() { - this(null); - } public ClassWithBaseArrayField(Base[] base) { this.base = base; } @@ -94,10 +86,6 @@ public class TestTypes { public static class StringWrapper { public final String someConstantStringInstanceField; - StringWrapper() { - this("Blah"); - } - public StringWrapper(String value) { someConstantStringInstanceField = value; } @@ -182,10 +170,6 @@ public class TestTypes { private final Integer intValue; private final Boolean booleanValue; - public BagOfPrimitiveWrappers() { - this(0L, 0, false); - } - public BagOfPrimitiveWrappers(Long longValue, Integer intValue, Boolean booleanValue) { this.longValue = longValue; this.intValue = intValue; diff --git a/gson/src/test/java/com/google/gson/functional/CollectionTest.java b/gson/src/test/java/com/google/gson/functional/CollectionTest.java index 0411a902..60741eaa 100644 --- a/gson/src/test/java/com/google/gson/functional/CollectionTest.java +++ b/gson/src/test/java/com/google/gson/functional/CollectionTest.java @@ -306,12 +306,6 @@ public class CollectionTest extends TestCase { private static class ObjectWithWildcardCollection { private final Collection collection; - // For use by Gson - @SuppressWarnings({ "unchecked", "unused" }) - public ObjectWithWildcardCollection() { - this(Collections.EMPTY_LIST); - } - public ObjectWithWildcardCollection(Collection collection) { this.collection = collection; } @@ -323,11 +317,6 @@ public class CollectionTest extends TestCase { private static class Entry { int value; - // For use by Gson - @SuppressWarnings("unused") - private Entry() { - this(10); - } Entry(int value) { this.value = value; } diff --git a/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java index 03d7333b..6af69791 100644 --- a/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java +++ b/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java @@ -427,12 +427,6 @@ public class CustomTypeAdaptersTest extends TestCase { private static class DataHolder { final String data; - // For use by Gson - @SuppressWarnings("unused") - private DataHolder() { - this(""); - } - public DataHolder(String data) { this.data = data; } @@ -441,12 +435,6 @@ public class CustomTypeAdaptersTest extends TestCase { private static class DataHolderWrapper { final DataHolder wrappedData; - // For use by Gson - @SuppressWarnings("unused") - private DataHolderWrapper() { - this(null); - } - public DataHolderWrapper(DataHolder data) { this.wrappedData = data; } diff --git a/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java index 026c668c..e130c5b5 100644 --- a/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java +++ b/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java @@ -397,9 +397,6 @@ public class DefaultTypeAdaptersTest extends TestCase { private static class ClassWithBigDecimal { BigDecimal value; - // For use by Gson - @SuppressWarnings("unused") - private ClassWithBigDecimal() { } ClassWithBigDecimal(String value) { this.value = new BigDecimal(value); } @@ -410,9 +407,6 @@ public class DefaultTypeAdaptersTest extends TestCase { private static class ClassWithBigInteger { BigInteger value; - // For use by Gson - @SuppressWarnings("unused") - private ClassWithBigInteger() { } ClassWithBigInteger(String value) { this.value = new BigInteger(value); } diff --git a/gson/src/test/java/com/google/gson/functional/ExposeFieldsTest.java b/gson/src/test/java/com/google/gson/functional/ExposeFieldsTest.java index a9ef78a3..586c270f 100644 --- a/gson/src/test/java/com/google/gson/functional/ExposeFieldsTest.java +++ b/gson/src/test/java/com/google/gson/functional/ExposeFieldsTest.java @@ -118,11 +118,6 @@ public class ExposeFieldsTest extends TestCase { @Expose(deserialize = false) final double d; @Expose(serialize = false, deserialize = false) final char e; - // For use by Gson - private ClassWithExposedFields() { - this(null, null); - } - public ClassWithExposedFields(Integer a, Integer b) { this(a, b, 1L, 2.0, 'a'); } @@ -168,12 +163,6 @@ public class ExposeFieldsTest extends TestCase { @Expose private final SomeInterface interfaceField; - // For use by Gson - @SuppressWarnings("unused") - private ClassWithInterfaceField() { - this(null); - } - public ClassWithInterfaceField(SomeInterface interfaceField) { this.interfaceField = interfaceField; } diff --git a/gson/src/test/java/com/google/gson/functional/InheritanceTest.java b/gson/src/test/java/com/google/gson/functional/InheritanceTest.java index ce65fd1f..2940d1a2 100644 --- a/gson/src/test/java/com/google/gson/functional/InheritanceTest.java +++ b/gson/src/test/java/com/google/gson/functional/InheritanceTest.java @@ -125,12 +125,6 @@ public class InheritanceTest extends TestCase { private static class SubTypeOfNested extends Nested { private final long value = 5; - // Used by Gson - @SuppressWarnings("unused") - private SubTypeOfNested() { - this(null, null); - } - public SubTypeOfNested(BagOfPrimitives primitive1, BagOfPrimitives primitive2) { super(primitive1, primitive2); } @@ -186,11 +180,6 @@ public class InheritanceTest extends TestCase { private Set set; private SortedSet sortedSet; - // For use by Gson - @SuppressWarnings("unused") - private ClassWithSubInterfacesOfCollection() { - } - public ClassWithSubInterfacesOfCollection(List list, Queue queue, Set set, SortedSet sortedSet) { this.list = list;