diff --git a/gson/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java b/gson/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java index e82f6771..23b4f00e 100644 --- a/gson/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java +++ b/gson/src/main/java/com/google/gson/CamelCaseSeparatorNamingPolicy.java @@ -16,6 +16,8 @@ package com.google.gson; +import com.google.gson.internal.Preconditions; + import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collection; diff --git a/gson/src/main/java/com/google/gson/DefaultTypeAdapters.java b/gson/src/main/java/com/google/gson/DefaultTypeAdapters.java index 69770eef..703599ce 100644 --- a/gson/src/main/java/com/google/gson/DefaultTypeAdapters.java +++ b/gson/src/main/java/com/google/gson/DefaultTypeAdapters.java @@ -16,6 +16,8 @@ package com.google.gson; +import com.google.gson.internal.Types; + import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.math.BigDecimal; diff --git a/gson/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java b/gson/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java index c44e1da9..fd9bf057 100644 --- a/gson/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java +++ b/gson/src/main/java/com/google/gson/DelegatingJsonElementVisitor.java @@ -16,6 +16,8 @@ package com.google.gson; +import com.google.gson.internal.Preconditions; + import java.io.IOException; /** diff --git a/gson/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java b/gson/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java index a5ad119c..d2058c2c 100644 --- a/gson/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java +++ b/gson/src/main/java/com/google/gson/DisjunctionExclusionStrategy.java @@ -16,6 +16,8 @@ package com.google.gson; +import com.google.gson.internal.Preconditions; + import java.util.Collection; /** diff --git a/gson/src/main/java/com/google/gson/FieldAttributes.java b/gson/src/main/java/com/google/gson/FieldAttributes.java index a85afd45..2bd6be5d 100644 --- a/gson/src/main/java/com/google/gson/FieldAttributes.java +++ b/gson/src/main/java/com/google/gson/FieldAttributes.java @@ -16,6 +16,11 @@ package com.google.gson; +import com.google.gson.internal.Cache; +import com.google.gson.internal.LruCache; +import com.google.gson.internal.Pair; +import com.google.gson.internal.Preconditions; + import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Type; diff --git a/gson/src/main/java/com/google/gson/FieldNamingStrategy2Adapter.java b/gson/src/main/java/com/google/gson/FieldNamingStrategy2Adapter.java index eeb8f863..3568a2b2 100644 --- a/gson/src/main/java/com/google/gson/FieldNamingStrategy2Adapter.java +++ b/gson/src/main/java/com/google/gson/FieldNamingStrategy2Adapter.java @@ -16,6 +16,8 @@ package com.google.gson; +import com.google.gson.internal.Preconditions; + /** * Adapts the old "deprecated" FieldNamingStrategy to the new {@link FieldNamingStrategy2} * type. diff --git a/gson/src/main/java/com/google/gson/Gson.java b/gson/src/main/java/com/google/gson/Gson.java index 64a5f4b1..20ace6a2 100644 --- a/gson/src/main/java/com/google/gson/Gson.java +++ b/gson/src/main/java/com/google/gson/Gson.java @@ -16,6 +16,7 @@ package com.google.gson; +import com.google.gson.internal.Primitives; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; diff --git a/gson/src/main/java/com/google/gson/GsonBuilder.java b/gson/src/main/java/com/google/gson/GsonBuilder.java index db0e8a50..53ea4688 100644 --- a/gson/src/main/java/com/google/gson/GsonBuilder.java +++ b/gson/src/main/java/com/google/gson/GsonBuilder.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.Set; import com.google.gson.DefaultTypeAdapters.DefaultDateTypeAdapter; +import com.google.gson.internal.Preconditions; /** *
Use this builder to construct a {@link Gson} instance when you need to set configuration
diff --git a/gson/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java b/gson/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java
index e1b1a258..4f5f0663 100644
--- a/gson/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java
+++ b/gson/src/main/java/com/google/gson/JsonArrayDeserializationVisitor.java
@@ -16,6 +16,8 @@
package com.google.gson;
+import com.google.gson.internal.Types;
+
import java.lang.reflect.Array;
import java.lang.reflect.Type;
diff --git a/gson/src/main/java/com/google/gson/JsonDeserializationVisitor.java b/gson/src/main/java/com/google/gson/JsonDeserializationVisitor.java
index bfd210f6..7937480b 100644
--- a/gson/src/main/java/com/google/gson/JsonDeserializationVisitor.java
+++ b/gson/src/main/java/com/google/gson/JsonDeserializationVisitor.java
@@ -16,6 +16,9 @@
package com.google.gson;
+import com.google.gson.internal.Pair;
+import com.google.gson.internal.Preconditions;
+
import java.lang.reflect.Type;
/**
diff --git a/gson/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java b/gson/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java
index 8562d214..41ef4e88 100644
--- a/gson/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java
+++ b/gson/src/main/java/com/google/gson/JsonDeserializerExceptionWrapper.java
@@ -16,6 +16,8 @@
package com.google.gson;
+import com.google.gson.internal.Preconditions;
+
import java.lang.reflect.Type;
/**
diff --git a/gson/src/main/java/com/google/gson/JsonFieldNameValidator.java b/gson/src/main/java/com/google/gson/JsonFieldNameValidator.java
index 55d174f6..2bee43ca 100644
--- a/gson/src/main/java/com/google/gson/JsonFieldNameValidator.java
+++ b/gson/src/main/java/com/google/gson/JsonFieldNameValidator.java
@@ -16,6 +16,8 @@
package com.google.gson;
+import com.google.gson.internal.Preconditions;
+
import java.util.regex.Matcher;
import java.util.regex.Pattern;
diff --git a/gson/src/main/java/com/google/gson/JsonObject.java b/gson/src/main/java/com/google/gson/JsonObject.java
index 82c93925..ede0ab9b 100644
--- a/gson/src/main/java/com/google/gson/JsonObject.java
+++ b/gson/src/main/java/com/google/gson/JsonObject.java
@@ -16,6 +16,8 @@
package com.google.gson;
+import com.google.gson.internal.Preconditions;
+
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/gson/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java b/gson/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java
index 7b267ec9..11c21f16 100644
--- a/gson/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java
+++ b/gson/src/main/java/com/google/gson/JsonObjectDeserializationVisitor.java
@@ -16,6 +16,9 @@
package com.google.gson;
+import com.google.gson.internal.Pair;
+import com.google.gson.internal.Primitives;
+
import java.lang.reflect.Type;
/**
diff --git a/gson/src/main/java/com/google/gson/JsonPrimitive.java b/gson/src/main/java/com/google/gson/JsonPrimitive.java
index 67f8de6f..ce58122a 100644
--- a/gson/src/main/java/com/google/gson/JsonPrimitive.java
+++ b/gson/src/main/java/com/google/gson/JsonPrimitive.java
@@ -16,6 +16,8 @@
package com.google.gson;
+import com.google.gson.internal.Preconditions;
+
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
diff --git a/gson/src/main/java/com/google/gson/JsonSerializationContextDefault.java b/gson/src/main/java/com/google/gson/JsonSerializationContextDefault.java
index c965eef1..f44302e8 100644
--- a/gson/src/main/java/com/google/gson/JsonSerializationContextDefault.java
+++ b/gson/src/main/java/com/google/gson/JsonSerializationContextDefault.java
@@ -16,6 +16,7 @@
package com.google.gson;
+
import java.lang.reflect.Type;
/**
diff --git a/gson/src/main/java/com/google/gson/JsonSerializationVisitor.java b/gson/src/main/java/com/google/gson/JsonSerializationVisitor.java
index b87dcac3..d67b2035 100644
--- a/gson/src/main/java/com/google/gson/JsonSerializationVisitor.java
+++ b/gson/src/main/java/com/google/gson/JsonSerializationVisitor.java
@@ -16,6 +16,10 @@
package com.google.gson;
+import com.google.gson.internal.Pair;
+import com.google.gson.internal.Preconditions;
+import com.google.gson.internal.Types;
+
import java.lang.reflect.Array;
import java.lang.reflect.Type;
@@ -168,7 +172,7 @@ final class JsonSerializationVisitor implements ObjectNavigator.Visitor {
/**
* objTypePair.getObject() must not be null
*/
- @SuppressWarnings({"unchecked", "rawtypes"})
+ @SuppressWarnings("unchecked")
private JsonElement findAndInvokeCustomSerializer(ObjectTypePair objTypePair) {
Pair
- * {@code TypeLiteral This syntax cannot be used to create type literals that have wildcard
* parameters, such as {@code Class>} or {@code List extends CharSequence>}.
- * Such type literals must be constructed programatically, either by {@link
+ * Such type tokens must be constructed programatically, either by {@link
* Method#getGenericReturnType extracting types from members} or by using the
* {@link Types} factory class.
*
diff --git a/gson/src/test/java/com/google/gson/GenericArrayTypeTest.java b/gson/src/test/java/com/google/gson/GenericArrayTypeTest.java
index 217c228c..71b8eea7 100644
--- a/gson/src/test/java/com/google/gson/GenericArrayTypeTest.java
+++ b/gson/src/test/java/com/google/gson/GenericArrayTypeTest.java
@@ -16,6 +16,7 @@
package com.google.gson;
+import com.google.gson.internal.Types;
import com.google.gson.reflect.TypeToken;
import junit.framework.TestCase;
diff --git a/gson/src/test/java/com/google/gson/LruCacheTest.java b/gson/src/test/java/com/google/gson/LruCacheTest.java
index dbf5034d..c9d01ee3 100644
--- a/gson/src/test/java/com/google/gson/LruCacheTest.java
+++ b/gson/src/test/java/com/google/gson/LruCacheTest.java
@@ -16,6 +16,9 @@
package com.google.gson;
+import com.google.gson.internal.Cache;
+import com.google.gson.internal.LruCache;
+
import junit.framework.TestCase;
/**
diff --git a/gson/src/test/java/com/google/gson/MemoryRefStackTest.java b/gson/src/test/java/com/google/gson/MemoryRefStackTest.java
index 0fad4197..35168c3f 100644
--- a/gson/src/test/java/com/google/gson/MemoryRefStackTest.java
+++ b/gson/src/test/java/com/google/gson/MemoryRefStackTest.java
@@ -16,7 +16,6 @@
package com.google.gson;
-import com.google.gson.MemoryRefStack;
import junit.framework.TestCase;
diff --git a/gson/src/test/java/com/google/gson/ParameterizedTypeTest.java b/gson/src/test/java/com/google/gson/ParameterizedTypeTest.java
index dbe354f8..aca57eca 100644
--- a/gson/src/test/java/com/google/gson/ParameterizedTypeTest.java
+++ b/gson/src/test/java/com/google/gson/ParameterizedTypeTest.java
@@ -16,6 +16,7 @@
package com.google.gson;
+import com.google.gson.internal.Types;
import com.google.gson.reflect.TypeToken;
import junit.framework.TestCase;
diff --git a/gson/src/test/java/com/google/gson/ParamterizedTypeFixtures.java b/gson/src/test/java/com/google/gson/ParamterizedTypeFixtures.java
index fc8526e2..45f8d474 100644
--- a/gson/src/test/java/com/google/gson/ParamterizedTypeFixtures.java
+++ b/gson/src/test/java/com/google/gson/ParamterizedTypeFixtures.java
@@ -16,6 +16,9 @@
package com.google.gson;
+import com.google.gson.internal.Primitives;
+import com.google.gson.internal.Types;
+
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
diff --git a/gson/src/test/java/com/google/gson/PrimitiveTypeAdapter.java b/gson/src/test/java/com/google/gson/PrimitiveTypeAdapter.java
index 90637e9f..2a71746f 100644
--- a/gson/src/test/java/com/google/gson/PrimitiveTypeAdapter.java
+++ b/gson/src/test/java/com/google/gson/PrimitiveTypeAdapter.java
@@ -21,7 +21,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import com.google.gson.JsonParseException;
-import com.google.gson.Primitives;
+import com.google.gson.internal.Primitives;
/**
* Handles type conversion from some object to some primitive (or primitive
diff --git a/gson/src/test/java/com/google/gson/functional/MapTest.java b/gson/src/test/java/com/google/gson/functional/MapTest.java
index efde9370..6c1cc39b 100755
--- a/gson/src/test/java/com/google/gson/functional/MapTest.java
+++ b/gson/src/test/java/com/google/gson/functional/MapTest.java
@@ -19,8 +19,6 @@ package com.google.gson.functional;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator;
-import com.google.gson.JsonElement;
-import com.google.gson.common.TestTypes.BagOfPrimitives;
import com.google.gson.reflect.TypeToken;
import junit.framework.TestCase;
diff --git a/gson/src/test/java/com/google/gson/functional/TypeHierarchyAdapterTest.java b/gson/src/test/java/com/google/gson/functional/TypeHierarchyAdapterTest.java
index 58eec7ae..54dc8ef6 100644
--- a/gson/src/test/java/com/google/gson/functional/TypeHierarchyAdapterTest.java
+++ b/gson/src/test/java/com/google/gson/functional/TypeHierarchyAdapterTest.java
@@ -133,10 +133,10 @@ public final class TypeHierarchyAdapterTest extends TestCase {
public void testRegisterSubTypeFirstNotAllowed() {
try {
- Gson gson = new GsonBuilder()
- .registerTypeHierarchyAdapter(Manager.class, new ManagerAdapter())
- .registerTypeHierarchyAdapter(Employee.class, new EmployeeAdapter())
- .create();
+ new GsonBuilder()
+ .registerTypeHierarchyAdapter(Manager.class, new ManagerAdapter())
+ .registerTypeHierarchyAdapter(Employee.class, new EmployeeAdapter())
+ .create();
fail();
} catch (IllegalArgumentException expected) {
}
> list = new TypeToken
>() {};}
+ * {@code TypeToken
> list = new TypeToken
>() {};}
*
*