diff -Nru libgoogle-gson-java-2.8.5/CHANGELOG.md libgoogle-gson-java-2.8.6/CHANGELOG.md --- libgoogle-gson-java-2.8.5/CHANGELOG.md 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/CHANGELOG.md 2019-10-04 18:54:03.000000000 +0000 @@ -1,6 +1,12 @@ Change Log ========== +## Version 2.8.5 +_2018-05-21_ [GitHub Diff](https://github.com/google/gson/compare/gson-parent-2.8.4...gson-parent-2.8.5) + * Print Gson version while throwing AssertionError and IllegalArgumentException + * Moved `utils.VersionUtils` class to `internal.JavaVersion`. This is a potential backward incompatible change from 2.8.4 + * Fixed issue https://github.com/google/gson/issues/1310 by supporting Debian Java 9 + ## Version 2.8.4 _2018-05-01_ [GitHub Diff](https://github.com/google/gson/compare/gson-parent-2.8.3...gson-parent-2.8.4) * Added a new FieldNamingPolicy, `LOWER_CASE_WITH_DOTS` that mapps JSON name `someFieldName` to `some.field.name` diff -Nru libgoogle-gson-java-2.8.5/debian/changelog libgoogle-gson-java-2.8.6/debian/changelog --- libgoogle-gson-java-2.8.5/debian/changelog 2019-01-25 10:54:04.000000000 +0000 +++ libgoogle-gson-java-2.8.6/debian/changelog 2020-05-31 20:32:55.000000000 +0000 @@ -1,3 +1,11 @@ +libgoogle-gson-java (2.8.6-1) unstable; urgency=medium + + * New upstream release + * Standards-Version updated to 4.5.0 + * Switch to debhelper level 12 + + -- Emmanuel Bourg Sun, 31 May 2020 22:32:55 +0200 + libgoogle-gson-java (2.8.5-3) unstable; urgency=medium * Team upload. diff -Nru libgoogle-gson-java-2.8.5/debian/compat libgoogle-gson-java-2.8.6/debian/compat --- libgoogle-gson-java-2.8.5/debian/compat 2019-01-25 10:54:04.000000000 +0000 +++ libgoogle-gson-java-2.8.6/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru libgoogle-gson-java-2.8.5/debian/control libgoogle-gson-java-2.8.6/debian/control --- libgoogle-gson-java-2.8.5/debian/control 2019-01-25 10:54:04.000000000 +0000 +++ libgoogle-gson-java-2.8.6/debian/control 2020-05-31 20:32:37.000000000 +0000 @@ -6,14 +6,14 @@ Jakub Adam , Emmanuel Bourg Build-Depends: - debhelper (>= 11), + debhelper-compat (= 12), default-jdk, javahelper, junit4, libmaven-bundle-plugin-java, libmaven-javadoc-plugin-java, maven-debian-helper -Standards-Version: 4.3.0 +Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/java-team/libgoogle-gson-java.git Vcs-Browser: https://salsa.debian.org/java-team/libgoogle-gson-java Homepage: https://github.com/google/gson diff -Nru libgoogle-gson-java-2.8.5/debian/rules libgoogle-gson-java-2.8.6/debian/rules --- libgoogle-gson-java-2.8.5/debian/rules 2019-01-25 10:54:04.000000000 +0000 +++ libgoogle-gson-java-2.8.6/debian/rules 2020-05-31 20:32:37.000000000 +0000 @@ -3,7 +3,7 @@ include /usr/share/dpkg/pkg-info.mk %: - dh $@ --with javahelper --buildsystem=maven + dh $@ --with javahelper override_dh_auto_build: cp -Rvp gson/src/main/java-templates/* gson/src/main/java/ diff -Nru libgoogle-gson-java-2.8.5/examples/android-proguard-example/proguard.cfg libgoogle-gson-java-2.8.6/examples/android-proguard-example/proguard.cfg --- libgoogle-gson-java-2.8.5/examples/android-proguard-example/proguard.cfg 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/examples/android-proguard-example/proguard.cfg 2019-10-04 18:54:03.000000000 +0000 @@ -11,12 +11,18 @@ #-keep class com.google.gson.stream.** { *; } # Application classes that will be serialized/deserialized over Gson --keep class com.google.gson.examples.android.model.** { *; } +-keep class com.google.gson.examples.android.model.** { ; } -# Prevent proguard from stripping interface information from TypeAdapterFactory, +# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) +-keep class * implements com.google.gson.TypeAdapter -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer +# Prevent R8 from leaving Data object members always null +-keepclassmembers,allowobfuscation class * { + @com.google.gson.annotations.SerializedName ; +} + ##---------------End: proguard configuration for Gson ---------- diff -Nru libgoogle-gson-java-2.8.5/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java libgoogle-gson-java-2.8.6/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java --- libgoogle-gson-java-2.8.5/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java 2019-10-04 18:54:03.000000000 +0000 @@ -104,9 +104,9 @@ * registered. This protects your application from injection attacks. If you * don't supply an explicit type label, the type's simple name will be used. *
   {@code
- *   shapeAdapter.registerSubtype(Rectangle.class, "Rectangle");
- *   shapeAdapter.registerSubtype(Circle.class, "Circle");
- *   shapeAdapter.registerSubtype(Diamond.class, "Diamond");
+ *   shapeAdapterFactory.registerSubtype(Rectangle.class, "Rectangle");
+ *   shapeAdapterFactory.registerSubtype(Circle.class, "Circle");
+ *   shapeAdapterFactory.registerSubtype(Diamond.class, "Diamond");
  * }
* Finally, register the type adapter factory in your application's GSON builder: *
   {@code
@@ -126,21 +126,32 @@
   private final String typeFieldName;
   private final Map> labelToSubtype = new LinkedHashMap>();
   private final Map, String> subtypeToLabel = new LinkedHashMap, String>();
+  private final boolean maintainType;
 
-  private RuntimeTypeAdapterFactory(Class baseType, String typeFieldName) {
+  private RuntimeTypeAdapterFactory(Class baseType, String typeFieldName, boolean maintainType) {
     if (typeFieldName == null || baseType == null) {
       throw new NullPointerException();
     }
     this.baseType = baseType;
     this.typeFieldName = typeFieldName;
+    this.maintainType = maintainType;
   }
 
   /**
    * Creates a new runtime type adapter using for {@code baseType} using {@code
    * typeFieldName} as the type field name. Type field names are case sensitive.
+   * {@code maintainType} flag decide if the type will be stored in pojo or not.
+   */
+  public static  RuntimeTypeAdapterFactory of(Class baseType, String typeFieldName, boolean maintainType) {
+    return new RuntimeTypeAdapterFactory(baseType, typeFieldName, maintainType);
+  }
+  
+  /**
+   * Creates a new runtime type adapter using for {@code baseType} using {@code
+   * typeFieldName} as the type field name. Type field names are case sensitive.
    */
   public static  RuntimeTypeAdapterFactory of(Class baseType, String typeFieldName) {
-    return new RuntimeTypeAdapterFactory(baseType, typeFieldName);
+    return new RuntimeTypeAdapterFactory(baseType, typeFieldName, false);
   }
 
   /**
@@ -148,7 +159,7 @@
    * the type field name.
    */
   public static  RuntimeTypeAdapterFactory of(Class baseType) {
-    return new RuntimeTypeAdapterFactory(baseType, "type");
+    return new RuntimeTypeAdapterFactory(baseType, "type", false);
   }
 
   /**
@@ -199,7 +210,13 @@
     return new TypeAdapter() {
       @Override public R read(JsonReader in) throws IOException {
         JsonElement jsonElement = Streams.parse(in);
-        JsonElement labelJsonElement = jsonElement.getAsJsonObject().remove(typeFieldName);
+        JsonElement labelJsonElement;
+        if (maintainType) {
+            labelJsonElement = jsonElement.getAsJsonObject().get(typeFieldName);
+        } else {
+            labelJsonElement = jsonElement.getAsJsonObject().remove(typeFieldName);
+        }
+        
         if (labelJsonElement == null) {
           throw new JsonParseException("cannot deserialize " + baseType
               + " because it does not define a field named " + typeFieldName);
@@ -224,12 +241,20 @@
               + "; did you forget to register a subtype?");
         }
         JsonObject jsonObject = delegate.toJsonTree(value).getAsJsonObject();
+
+        if (maintainType) {
+          Streams.write(jsonObject, out);
+          return;
+        }
+
+        JsonObject clone = new JsonObject();
+
         if (jsonObject.has(typeFieldName)) {
           throw new JsonParseException("cannot serialize " + srcType.getName()
               + " because it already defines a field named " + typeFieldName);
         }
-        JsonObject clone = new JsonObject();
         clone.add(typeFieldName, new JsonPrimitive(label));
+        
         for (Map.Entry e : jsonObject.entrySet()) {
           clone.add(e.getKey(), e.getValue());
         }
diff -Nru libgoogle-gson-java-2.8.5/.gitattributes libgoogle-gson-java-2.8.6/.gitattributes
--- libgoogle-gson-java-2.8.5/.gitattributes	1970-01-01 00:00:00.000000000 +0000
+++ libgoogle-gson-java-2.8.6/.gitattributes	2019-10-04 18:54:03.000000000 +0000
@@ -0,0 +1 @@
+gson/docs/javadocs/* linguist-documentation
diff -Nru libgoogle-gson-java-2.8.5/gson/build.gradle libgoogle-gson-java-2.8.6/gson/build.gradle
--- libgoogle-gson-java-2.8.5/gson/build.gradle	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/build.gradle	2019-10-04 18:54:03.000000000 +0000
@@ -2,7 +2,7 @@
 apply plugin: 'maven'
 
 group = 'com.google.code.gson'
-version = '2.8.4-SNAPSHOT'
+version = '2.8.6-SNAPSHOT'
 
 sourceCompatibility = 1.6
 targetCompatibility = 1.6
diff -Nru libgoogle-gson-java-2.8.5/gson/pom.xml libgoogle-gson-java-2.8.6/gson/pom.xml
--- libgoogle-gson-java-2.8.5/gson/pom.xml	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/pom.xml	2019-10-04 18:54:03.000000000 +0000
@@ -4,7 +4,7 @@
   
     com.google.code.gson
     gson-parent
-    2.8.5
+    2.8.6
   
 
   gson
@@ -34,7 +34,7 @@
       
         biz.aQute.bnd
         bnd-maven-plugin
-        3.1.0
+        4.0.0
         
           
             
diff -Nru libgoogle-gson-java-2.8.5/gson/README libgoogle-gson-java-2.8.6/gson/README
--- libgoogle-gson-java-2.8.5/gson/README	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/README	2019-10-04 18:54:03.000000000 +0000
@@ -1,5 +1,5 @@
-Gson is a Java library that can be used to convert a Java object into its 
-JSON representation. It can also be used to convert a JSON string into an 
+Gson is a Java library that can be used to convert Java Objects into their 
+JSON representation. It can also be used to convert a JSON string to an 
 equivalent Java object. Gson can work with arbitrary Java objects including 
 pre-existing objects that you do not have source-code of.
 
diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/annotations/SerializedName.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/annotations/SerializedName.java
--- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/annotations/SerializedName.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/annotations/SerializedName.java	2019-10-04 18:54:03.000000000 +0000
@@ -28,7 +28,7 @@
  *
  * 

This annotation will override any {@link com.google.gson.FieldNamingPolicy}, including * the default field naming policy, that may have been set on the {@link com.google.gson.Gson} - * instance. A different naming policy can set using the {@code GsonBuilder} class. See + * instance. A different naming policy can set using the {@code GsonBuilder} class. See * {@link com.google.gson.GsonBuilder#setFieldNamingPolicy(com.google.gson.FieldNamingPolicy)} * for more information.

* diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/annotations/Until.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/annotations/Until.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/annotations/Until.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/annotations/Until.java 2019-10-04 18:54:03.000000000 +0000 @@ -25,7 +25,7 @@ /** * An annotation that indicates the version number until a member or a type should be present. * Basically, if Gson is created with a version number that exceeds the value stored in the - * {@code Until} annotation then the field will be ignored from the JSON output. This annotation + * {@code Until} annotation then the field will be ignored from the JSON output. This annotation * is useful to manage versioning of your JSON classes for a web-service. * *

diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/ExclusionStrategy.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/ExclusionStrategy.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/ExclusionStrategy.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/ExclusionStrategy.java 2019-10-04 18:54:03.000000000 +0000 @@ -20,7 +20,7 @@ * A strategy (or policy) definition that is used to decide whether or not a field or top-level * class should be serialized or deserialized as part of the JSON output/input. For serialization, * if the {@link #shouldSkipClass(Class)} method returns true then that class or field type - * will not be part of the JSON output. For deserialization, if {@link #shouldSkipClass(Class)} + * will not be part of the JSON output. For deserialization, if {@link #shouldSkipClass(Class)} * returns true, then it will not be set as part of the Java object structure. * *

The following are a few examples that shows how you can use this exclusion mechanism. diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/FieldNamingPolicy.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/FieldNamingPolicy.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/FieldNamingPolicy.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/FieldNamingPolicy.java 2019-10-04 18:54:03.000000000 +0000 @@ -159,31 +159,20 @@ * Ensures the JSON field names begins with an upper case letter. */ static String upperCaseFirstLetter(String name) { - StringBuilder fieldNameBuilder = new StringBuilder(); - int index = 0; - char firstCharacter = name.charAt(index); - int length = name.length(); + int firstLetterIndex = 0; + int limit = name.length() - 1; + for(; !Character.isLetter(name.charAt(firstLetterIndex)) && firstLetterIndex < limit; ++firstLetterIndex); - while (index < length - 1) { - if (Character.isLetter(firstCharacter)) { - break; - } - - fieldNameBuilder.append(firstCharacter); - firstCharacter = name.charAt(++index); + char firstLetter = name.charAt(firstLetterIndex); + if(Character.isUpperCase(firstLetter)) { //The letter is already uppercased, return the original + return name; } - if (!Character.isUpperCase(firstCharacter)) { - String modifiedTarget = modifyString(Character.toUpperCase(firstCharacter), name, ++index); - return fieldNameBuilder.append(modifiedTarget).toString(); - } else { - return name; + char uppercased = Character.toUpperCase(firstLetter); + if(firstLetterIndex == 0) { //First character in the string is the first letter, saves 1 substring + return uppercased + name.substring(1); } - } - private static String modifyString(char firstCharacter, String srcString, int indexOfSubstring) { - return (indexOfSubstring < srcString.length()) - ? firstCharacter + srcString.substring(indexOfSubstring) - : String.valueOf(firstCharacter); + return name.substring(0, firstLetterIndex) + uppercased + name.substring(firstLetterIndex + 1); } } diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/FieldNamingStrategy.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/FieldNamingStrategy.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/FieldNamingStrategy.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/FieldNamingStrategy.java 2019-10-04 18:54:03.000000000 +0000 @@ -19,9 +19,9 @@ import java.lang.reflect.Field; /** - * A mechanism for providing custom field naming in Gson. This allows the client code to translate + * A mechanism for providing custom field naming in Gson. This allows the client code to translate * field names into a particular convention that is not supported as a normal Java field - * declaration rules. For example, Java does not support "-" characters in a field name. + * declaration rules. For example, Java does not support "-" characters in a field name. * * @author Inderjeet Singh * @author Joel Leitch diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/Gson.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/Gson.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/Gson.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/Gson.java 2019-10-04 18:54:03.000000000 +0000 @@ -80,7 +80,7 @@ * *

If the object that your are serializing/deserializing is a {@code ParameterizedType} * (i.e. contains at least one type parameter and may be an array) then you must use the - * {@link #toJson(Object, Type)} or {@link #fromJson(String, Type)} method. Here is an + * {@link #toJson(Object, Type)} or {@link #fromJson(String, Type)} method. Here is an * example for serializing and deserializing a {@code ParameterizedType}: * *

@@ -192,8 +192,8 @@
         Collections.emptyList());
   }
 
-  Gson(final Excluder excluder, final FieldNamingStrategy fieldNamingStrategy,
-      final Map> instanceCreators, boolean serializeNulls,
+  Gson(Excluder excluder, FieldNamingStrategy fieldNamingStrategy,
+      Map> instanceCreators, boolean serializeNulls,
       boolean complexMapKeySerialization, boolean generateNonExecutableGson, boolean htmlSafe,
       boolean prettyPrinting, boolean lenient, boolean serializeSpecialFloatingPointValues,
       LongSerializationPolicy longSerializationPolicy, String datePattern, int dateStyle,
@@ -705,7 +705,9 @@
     } catch (IOException e) {
       throw new JsonIOException(e);
     } catch (AssertionError e) {
-      throw new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage(), e);
+      AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage());
+      error.initCause(e);
+      throw error;
     } finally {
       writer.setLenient(oldLenient);
       writer.setHtmlSafe(oldHtmlSafe);
@@ -783,7 +785,9 @@
     } catch (IOException e) {
       throw new JsonIOException(e);
     } catch (AssertionError e) {
-      throw new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage(), e);
+      AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage());
+      error.initCause(e);
+      throw error;
     } finally {
       writer.setLenient(oldLenient);
       writer.setHtmlSafe(oldHtmlSafe);
@@ -828,7 +832,8 @@
    * 
    * Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
    * 
- * @return an object of type T from the string. Returns {@code null} if {@code json} is {@code null}. + * @return an object of type T from the string. Returns {@code null} if {@code json} is {@code null} + * or if {@code json} is empty. * @throws JsonParseException if json is not a valid representation for an object of type typeOfT * @throws JsonSyntaxException if json is not a valid representation for an object of type */ @@ -941,7 +946,9 @@ // TODO(inder): Figure out whether it is indeed right to rethrow this as JsonSyntaxException throw new JsonSyntaxException(e); } catch (AssertionError e) { - throw new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage(), e); + AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage()); + error.initCause(e); + throw error; } finally { reader.setLenient(oldLenient); } @@ -959,7 +966,8 @@ * @param json the root of the parse tree of {@link JsonElement}s from which the object is to * be deserialized * @param classOfT The class of T - * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null}. + * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null} + * or if {@code json} is empty. * @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT * @since 1.3 */ @@ -982,7 +990,8 @@ *
    * Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
    * 
- * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null}. + * @return an object of type T from the json. Returns {@code null} if {@code json} is {@code null} + * or if {@code json} is empty. * @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT * @since 1.3 */ diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/internal/bind/JsonTreeReader.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/internal/bind/JsonTreeReader.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/internal/bind/JsonTreeReader.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/internal/bind/JsonTreeReader.java 2019-10-04 18:54:03.000000000 +0000 @@ -27,6 +27,7 @@ import java.io.Reader; import java.util.Iterator; import java.util.Map; +import java.util.Arrays; /** * This reader walks the elements of a JsonElement as if it was coming from a @@ -282,15 +283,10 @@ private void push(Object newTop) { if (stackSize == stack.length) { - Object[] newStack = new Object[stackSize * 2]; - int[] newPathIndices = new int[stackSize * 2]; - String[] newPathNames = new String[stackSize * 2]; - System.arraycopy(stack, 0, newStack, 0, stackSize); - System.arraycopy(pathIndices, 0, newPathIndices, 0, stackSize); - System.arraycopy(pathNames, 0, newPathNames, 0, stackSize); - stack = newStack; - pathIndices = newPathIndices; - pathNames = newPathNames; + int newLength = stackSize * 2; + stack = Arrays.copyOf(stack, newLength); + pathIndices = Arrays.copyOf(pathIndices, newLength); + pathNames = Arrays.copyOf(pathNames, newLength); } stack[stackSize++] = newTop; } diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/internal/Primitives.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/internal/Primitives.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/internal/Primitives.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/internal/Primitives.java 2019-10-04 18:54:03.000000000 +0000 @@ -16,11 +16,7 @@ package com.google.gson.internal; - import java.lang.reflect.Type; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; /** * Contains static utility methods pertaining to primitive types and their @@ -29,47 +25,13 @@ * @author Kevin Bourrillion */ public final class Primitives { - private Primitives() { - throw new UnsupportedOperationException(); - } - - /** A map from primitive types to their corresponding wrapper types. */ - private static final Map, Class> PRIMITIVE_TO_WRAPPER_TYPE; - - /** A map from wrapper types to their corresponding primitive types. */ - private static final Map, Class> WRAPPER_TO_PRIMITIVE_TYPE; - - // Sad that we can't use a BiMap. :( - - static { - Map, Class> primToWrap = new HashMap, Class>(16); - Map, Class> wrapToPrim = new HashMap, Class>(16); - - add(primToWrap, wrapToPrim, boolean.class, Boolean.class); - add(primToWrap, wrapToPrim, byte.class, Byte.class); - add(primToWrap, wrapToPrim, char.class, Character.class); - add(primToWrap, wrapToPrim, double.class, Double.class); - add(primToWrap, wrapToPrim, float.class, Float.class); - add(primToWrap, wrapToPrim, int.class, Integer.class); - add(primToWrap, wrapToPrim, long.class, Long.class); - add(primToWrap, wrapToPrim, short.class, Short.class); - add(primToWrap, wrapToPrim, void.class, Void.class); - - PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap); - WRAPPER_TO_PRIMITIVE_TYPE = Collections.unmodifiableMap(wrapToPrim); - } - - private static void add(Map, Class> forward, - Map, Class> backward, Class key, Class value) { - forward.put(key, value); - backward.put(value, key); - } + private Primitives() {} /** * Returns true if this type is a primitive. */ public static boolean isPrimitive(Type type) { - return PRIMITIVE_TO_WRAPPER_TYPE.containsKey(type); + return type instanceof Class && ((Class) type).isPrimitive(); } /** @@ -79,8 +41,15 @@ * @see Class#isPrimitive */ public static boolean isWrapperType(Type type) { - return WRAPPER_TO_PRIMITIVE_TYPE.containsKey( - $Gson$Preconditions.checkNotNull(type)); + return type == Integer.class + || type == Float.class + || type == Byte.class + || type == Double.class + || type == Long.class + || type == Character.class + || type == Boolean.class + || type == Short.class + || type == Void.class; } /** @@ -92,12 +61,18 @@ * wrap(String.class) == String.class *
*/ + @SuppressWarnings("unchecked") public static Class wrap(Class type) { - // cast is safe: long.class and Long.class are both of type Class - @SuppressWarnings("unchecked") - Class wrapped = (Class) PRIMITIVE_TO_WRAPPER_TYPE.get( - $Gson$Preconditions.checkNotNull(type)); - return (wrapped == null) ? type : wrapped; + if (type == int.class) return (Class) Integer.class; + if (type == float.class) return (Class) Float.class; + if (type == byte.class) return (Class) Byte.class; + if (type == double.class) return (Class) Double.class; + if (type == long.class) return (Class) Long.class; + if (type == char.class) return (Class) Character.class; + if (type == boolean.class) return (Class) Boolean.class; + if (type == short.class) return (Class) Short.class; + if (type == void.class) return (Class) Void.class; + return type; } /** @@ -109,11 +84,17 @@ * unwrap(String.class) == String.class *
*/ + @SuppressWarnings("unchecked") public static Class unwrap(Class type) { - // cast is safe: long.class and Long.class are both of type Class - @SuppressWarnings("unchecked") - Class unwrapped = (Class) WRAPPER_TO_PRIMITIVE_TYPE.get( - $Gson$Preconditions.checkNotNull(type)); - return (unwrapped == null) ? type : unwrapped; + if (type == Integer.class) return (Class) int.class; + if (type == Float.class) return (Class) float.class; + if (type == Byte.class) return (Class) byte.class; + if (type == Double.class) return (Class) double.class; + if (type == Long.class) return (Class) long.class; + if (type == Character.class) return (Class) char.class; + if (type == Boolean.class) return (Class) boolean.class; + if (type == Short.class) return (Class) short.class; + if (type == Void.class) return (Class) void.class; + return type; } } diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonElement.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonElement.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonElement.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonElement.java 2019-10-04 18:54:03.000000000 +0000 @@ -154,19 +154,6 @@ } /** - * convenience method to get this element as a {@link Boolean} value. - * - * @return get this element as a {@link Boolean} value. - * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid - * boolean value. - * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains - * more than a single element. - */ - Boolean getAsBooleanWrapper() { - throw new UnsupportedOperationException(getClass().getSimpleName()); - } - - /** * convenience method to get this element as a {@link Number}. * * @return get this element as a {@link Number}. @@ -259,15 +246,19 @@ } /** - * convenience method to get this element as a primitive character value. + * convenience method to get the first character of this element as a string or the first + * character of this array's first element as a string. * - * @return get this element as a primitive char value. + * @return the first character of the string. * @throws ClassCastException if the element is of not a {@link JsonPrimitive} and is not a valid - * char value. + * string value. * @throws IllegalStateException if the element is of the type {@link JsonArray} but contains * more than a single element. * @since 1.3 + * @deprecated This method is misleading, as it does not get this element as a char but rather as + * a string's first character. */ + @Deprecated public char getAsCharacter() { throw new UnsupportedOperationException(getClass().getSimpleName()); } diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonObject.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonObject.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonObject.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonObject.java 2019-10-04 18:54:03.000000000 +0000 @@ -55,10 +55,7 @@ * @param value the member object. */ public void add(String property, JsonElement value) { - if (value == null) { - value = JsonNull.INSTANCE; - } - members.put(property, value); + members.put(property, value == null ? JsonNull.INSTANCE : value); } /** @@ -80,7 +77,7 @@ * @param value the string value associated with the member. */ public void addProperty(String property, String value) { - add(property, createJsonElement(value)); + add(property, value == null ? JsonNull.INSTANCE : new JsonPrimitive(value)); } /** @@ -91,7 +88,7 @@ * @param value the number value associated with the member. */ public void addProperty(String property, Number value) { - add(property, createJsonElement(value)); + add(property, value == null ? JsonNull.INSTANCE : new JsonPrimitive(value)); } /** @@ -102,7 +99,7 @@ * @param value the number value associated with the member. */ public void addProperty(String property, Boolean value) { - add(property, createJsonElement(value)); + add(property, value == null ? JsonNull.INSTANCE : new JsonPrimitive(value)); } /** @@ -113,17 +110,7 @@ * @param value the number value associated with the member. */ public void addProperty(String property, Character value) { - add(property, createJsonElement(value)); - } - - /** - * Creates the proper {@link JsonElement} object from the given {@code value} object. - * - * @param value the object to generate the {@link JsonElement} for - * @return a {@link JsonPrimitive} if the {@code value} is not null, otherwise a {@link JsonNull} - */ - private JsonElement createJsonElement(Object value) { - return value == null ? JsonNull.INSTANCE : new JsonPrimitive(value); + add(property, value == null ? JsonNull.INSTANCE : new JsonPrimitive(value)); } /** diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonParseException.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonParseException.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonParseException.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonParseException.java 2019-10-04 18:54:03.000000000 +0000 @@ -18,12 +18,12 @@ /** * This exception is raised if there is a serious issue that occurs during parsing of a Json - * string. One of the main usages for this class is for the Gson infrastructure. If the incoming + * string. One of the main usages for this class is for the Gson infrastructure. If the incoming * Json is bad/malicious, an instance of this exception is raised. * - *

This exception is a {@link RuntimeException} because it is exposed to the client. Using a + *

This exception is a {@link RuntimeException} because it is exposed to the client. Using a * {@link RuntimeException} avoids bad coding practices on the client side where they catch the - * exception and do nothing. It is often the case that you want to blow up if there is a parsing + * exception and do nothing. It is often the case that you want to blow up if there is a parsing * error (i.e. often clients do not know how to recover from a {@link JsonParseException}.

* * @author Inderjeet Singh diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonParser.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonParser.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonParser.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonParser.java 2019-10-04 18:54:03.000000000 +0000 @@ -32,6 +32,9 @@ * @since 1.3 */ public final class JsonParser { + /** @deprecated No need to instantiate this class, use the static methods instead. */ + @Deprecated + public JsonParser() {} /** * Parses the specified JSON string into a parse tree @@ -39,24 +42,22 @@ * @param json JSON text * @return a parse tree of {@link JsonElement}s corresponding to the specified JSON * @throws JsonParseException if the specified text is not valid JSON - * @since 1.3 */ - public JsonElement parse(String json) throws JsonSyntaxException { - return parse(new StringReader(json)); + public static JsonElement parseString(String json) throws JsonSyntaxException { + return parseReader(new StringReader(json)); } /** * Parses the specified JSON string into a parse tree * - * @param json JSON text + * @param reader JSON text * @return a parse tree of {@link JsonElement}s corresponding to the specified JSON * @throws JsonParseException if the specified text is not valid JSON - * @since 1.3 */ - public JsonElement parse(Reader json) throws JsonIOException, JsonSyntaxException { + public static JsonElement parseReader(Reader reader) throws JsonIOException, JsonSyntaxException { try { - JsonReader jsonReader = new JsonReader(json); - JsonElement element = parse(jsonReader); + JsonReader jsonReader = new JsonReader(reader); + JsonElement element = parseReader(jsonReader); if (!element.isJsonNull() && jsonReader.peek() != JsonToken.END_DOCUMENT) { throw new JsonSyntaxException("Did not consume the entire document."); } @@ -75,19 +76,37 @@ * * @throws JsonParseException if there is an IOException or if the specified * text is not valid JSON - * @since 1.6 */ - public JsonElement parse(JsonReader json) throws JsonIOException, JsonSyntaxException { - boolean lenient = json.isLenient(); - json.setLenient(true); + public static JsonElement parseReader(JsonReader reader) + throws JsonIOException, JsonSyntaxException { + boolean lenient = reader.isLenient(); + reader.setLenient(true); try { - return Streams.parse(json); + return Streams.parse(reader); } catch (StackOverflowError e) { - throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e); + throw new JsonParseException("Failed parsing JSON source: " + reader + " to Json", e); } catch (OutOfMemoryError e) { - throw new JsonParseException("Failed parsing JSON source: " + json + " to Json", e); + throw new JsonParseException("Failed parsing JSON source: " + reader + " to Json", e); } finally { - json.setLenient(lenient); + reader.setLenient(lenient); } } + + /** @deprecated Use {@link JsonParser#parseString} */ + @Deprecated + public JsonElement parse(String json) throws JsonSyntaxException { + return parseString(json); + } + + /** @deprecated Use {@link JsonParser#parseReader(Reader)} */ + @Deprecated + public JsonElement parse(Reader json) throws JsonIOException, JsonSyntaxException { + return parseReader(json); + } + + /** @deprecated Use {@link JsonParser#parseReader(JsonReader)} */ + @Deprecated + public JsonElement parse(JsonReader json) throws JsonIOException, JsonSyntaxException { + return parseReader(json); + } } diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonPrimitive.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonPrimitive.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonPrimitive.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonPrimitive.java 2019-10-04 18:54:03.000000000 +0000 @@ -16,10 +16,10 @@ package com.google.gson; +import com.google.gson.internal.$Gson$Preconditions; import java.math.BigDecimal; import java.math.BigInteger; -import com.google.gson.internal.$Gson$Preconditions; import com.google.gson.internal.LazilyParsedNumber; /** @@ -32,11 +32,7 @@ */ public final class JsonPrimitive extends JsonElement { - private static final Class[] PRIMITIVE_TYPES = { int.class, long.class, short.class, - float.class, double.class, byte.class, boolean.class, char.class, Integer.class, Long.class, - Short.class, Float.class, Double.class, Byte.class, Boolean.class, Character.class }; - - private Object value; + private final Object value; /** * Create a primitive containing a boolean value. @@ -44,7 +40,7 @@ * @param bool the value to create the primitive with. */ public JsonPrimitive(Boolean bool) { - setValue(bool); + value = $Gson$Preconditions.checkNotNull(bool); } /** @@ -53,7 +49,7 @@ * @param number the value to create the primitive with. */ public JsonPrimitive(Number number) { - setValue(number); + value = $Gson$Preconditions.checkNotNull(number); } /** @@ -62,7 +58,7 @@ * @param string the value to create the primitive with. */ public JsonPrimitive(String string) { - setValue(string); + value = $Gson$Preconditions.checkNotNull(string); } /** @@ -72,17 +68,9 @@ * @param c the value to create the primitive with. */ public JsonPrimitive(Character c) { - setValue(c); - } - - /** - * Create a primitive using the specified Object. It must be an instance of {@link Number}, a - * Java primitive type, or a String. - * - * @param primitive the value to create the primitive with. - */ - JsonPrimitive(Object primitive) { - setValue(primitive); + // convert characters to strings since in JSON, characters are represented as a single + // character string + value = $Gson$Preconditions.checkNotNull(c).toString(); } /** @@ -94,19 +82,6 @@ return this; } - void setValue(Object primitive) { - if (primitive instanceof Character) { - // convert characters to strings since in JSON, characters are represented as a single - // character string - char c = ((Character) primitive).charValue(); - this.value = String.valueOf(c); - } else { - $Gson$Preconditions.checkArgument(primitive instanceof Number - || isPrimitiveOrString(primitive)); - this.value = primitive; - } - } - /** * Check whether this primitive contains a boolean value. * @@ -117,16 +92,6 @@ } /** - * convenience method to get this element as a {@link Boolean}. - * - * @return get this element as a {@link Boolean}. - */ - @Override - Boolean getAsBooleanWrapper() { - return (Boolean) value; - } - - /** * convenience method to get this element as a boolean value. * * @return get this element as a primitive boolean value. @@ -134,11 +99,10 @@ @Override public boolean getAsBoolean() { if (isBoolean()) { - return getAsBooleanWrapper().booleanValue(); - } else { - // Check to see if the value as a String is "true" in any case. - return Boolean.parseBoolean(getAsString()); + return ((Boolean) value).booleanValue(); } + // Check to see if the value as a String is "true" in any case. + return Boolean.parseBoolean(getAsString()); } /** @@ -180,7 +144,7 @@ if (isNumber()) { return getAsNumber().toString(); } else if (isBoolean()) { - return getAsBooleanWrapper().toString(); + return ((Boolean) value).toString(); } else { return (String) value; } @@ -274,20 +238,6 @@ return getAsString().charAt(0); } - private static boolean isPrimitiveOrString(Object target) { - if (target instanceof String) { - return true; - } - - Class classOfPrimitive = target.getClass(); - for (Class standardPrimitive : PRIMITIVE_TYPES) { - if (standardPrimitive.isAssignableFrom(classOfPrimitive)) { - return true; - } - } - return false; - } - @Override public int hashCode() { if (value == null) { diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonStreamParser.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonStreamParser.java --- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/JsonStreamParser.java 2018-05-22 03:08:09.000000000 +0000 +++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/JsonStreamParser.java 2019-10-04 18:54:03.000000000 +0000 @@ -33,7 +33,7 @@ * *

This class is conditionally thread-safe (see Item 70, Effective Java second edition). To * properly use this class across multiple threads, you will need to add some external - * synchronization. For example: + * synchronization. For example: * *

  * JsonStreamParser parser = new JsonStreamParser("['first'] {'second':10} 'third'");
diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/LongSerializationPolicy.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/LongSerializationPolicy.java
--- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/LongSerializationPolicy.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/LongSerializationPolicy.java	2019-10-04 18:54:03.000000000 +0000
@@ -27,7 +27,7 @@
 public enum LongSerializationPolicy {
   /**
    * This is the "default" serialization policy that will output a {@code long} object as a JSON
-   * number.  For example, assume an object has a long field named "f" then the serialized output
+   * number. For example, assume an object has a long field named "f" then the serialized output
    * would be:
    * {@code {"f":123}}.
    */
@@ -38,7 +38,7 @@
   },
   
   /**
-   * Serializes a long value as a quoted string.  For example, assume an object has a long field 
+   * Serializes a long value as a quoted string. For example, assume an object has a long field 
    * named "f" then the serialized output would be:
    * {@code {"f":"123"}}.
    */
diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/stream/JsonReader.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/stream/JsonReader.java
--- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/stream/JsonReader.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/stream/JsonReader.java	2019-10-04 18:54:03.000000000 +0000
@@ -22,6 +22,7 @@
 import java.io.EOFException;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Arrays;
 
 /**
  * Reads a JSON (RFC 7159)
@@ -1262,15 +1263,10 @@
 
   private void push(int newTop) {
     if (stackSize == stack.length) {
-      int[] newStack = new int[stackSize * 2];
-      int[] newPathIndices = new int[stackSize * 2];
-      String[] newPathNames = new String[stackSize * 2];
-      System.arraycopy(stack, 0, newStack, 0, stackSize);
-      System.arraycopy(pathIndices, 0, newPathIndices, 0, stackSize);
-      System.arraycopy(pathNames, 0, newPathNames, 0, stackSize);
-      stack = newStack;
-      pathIndices = newPathIndices;
-      pathNames = newPathNames;
+      int newLength = stackSize * 2;
+      stack = Arrays.copyOf(stack, newLength);
+      pathIndices = Arrays.copyOf(pathIndices, newLength);
+      pathNames = Arrays.copyOf(pathNames, newLength);
     }
     stack[stackSize++] = newTop;
   }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/stream/JsonWriter.java libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/stream/JsonWriter.java
--- libgoogle-gson-java-2.8.5/gson/src/main/java/com/google/gson/stream/JsonWriter.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/main/java/com/google/gson/stream/JsonWriter.java	2019-10-04 18:54:03.000000000 +0000
@@ -20,6 +20,7 @@
 import java.io.Flushable;
 import java.io.IOException;
 import java.io.Writer;
+import java.util.Arrays;
 
 import static com.google.gson.stream.JsonScope.DANGLING_NAME;
 import static com.google.gson.stream.JsonScope.EMPTY_ARRAY;
@@ -285,7 +286,7 @@
    */
   public JsonWriter beginArray() throws IOException {
     writeDeferredName();
-    return open(EMPTY_ARRAY, "[");
+    return open(EMPTY_ARRAY, '[');
   }
 
   /**
@@ -294,7 +295,7 @@
    * @return this writer.
    */
   public JsonWriter endArray() throws IOException {
-    return close(EMPTY_ARRAY, NONEMPTY_ARRAY, "]");
+    return close(EMPTY_ARRAY, NONEMPTY_ARRAY, ']');
   }
 
   /**
@@ -305,7 +306,7 @@
    */
   public JsonWriter beginObject() throws IOException {
     writeDeferredName();
-    return open(EMPTY_OBJECT, "{");
+    return open(EMPTY_OBJECT, '{');
   }
 
   /**
@@ -314,14 +315,14 @@
    * @return this writer.
    */
   public JsonWriter endObject() throws IOException {
-    return close(EMPTY_OBJECT, NONEMPTY_OBJECT, "}");
+    return close(EMPTY_OBJECT, NONEMPTY_OBJECT, '}');
   }
 
   /**
    * Enters a new scope by appending any necessary whitespace and the given
    * bracket.
    */
-  private JsonWriter open(int empty, String openBracket) throws IOException {
+  private JsonWriter open(int empty, char openBracket) throws IOException {
     beforeValue();
     push(empty);
     out.write(openBracket);
@@ -332,7 +333,7 @@
    * Closes the current scope by appending any necessary whitespace and the
    * given bracket.
    */
-  private JsonWriter close(int empty, int nonempty, String closeBracket)
+  private JsonWriter close(int empty, int nonempty, char closeBracket)
       throws IOException {
     int context = peek();
     if (context != nonempty && context != empty) {
@@ -352,9 +353,7 @@
 
   private void push(int newTop) {
     if (stackSize == stack.length) {
-      int[] newStack = new int[stackSize * 2];
-      System.arraycopy(stack, 0, newStack, 0, stackSize);
-      stack = newStack;
+      stack = Arrays.copyOf(stack, stackSize * 2);
     }
     stack[stackSize++] = newTop;
   }
@@ -563,7 +562,7 @@
 
   private void string(String value) throws IOException {
     String[] replacements = htmlSafe ? HTML_SAFE_REPLACEMENT_CHARS : REPLACEMENT_CHARS;
-    out.write("\"");
+    out.write('\"');
     int last = 0;
     int length = value.length();
     for (int i = 0; i < length; i++) {
@@ -590,7 +589,7 @@
     if (last < length) {
       out.write(value, last, length - last);
     }
-    out.write("\"");
+    out.write('\"');
   }
 
   private void newline() throws IOException {
@@ -598,7 +597,7 @@
       return;
     }
 
-    out.write("\n");
+    out.write('\n');
     for (int i = 1, size = stackSize; i < size; i++) {
       out.write(indent);
     }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/com.google.gson/module-info.java libgoogle-gson-java-2.8.6/gson/src/main/java/com.google.gson/module-info.java
--- libgoogle-gson-java-2.8.5/gson/src/main/java/com.google.gson/module-info.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/main/java/com.google.gson/module-info.java	1970-01-01 00:00:00.000000000 +0000
@@ -1,8 +0,0 @@
-module com.google.gson {
-	exports com.google.gson;
-	exports com.google.gson.annotations;
-	exports com.google.gson.reflect;
-	exports com.google.gson.stream;
-
-	requires java.sql;
-}
diff -Nru libgoogle-gson-java-2.8.5/gson/src/main/java/module-info.java libgoogle-gson-java-2.8.6/gson/src/main/java/module-info.java
--- libgoogle-gson-java-2.8.5/gson/src/main/java/module-info.java	1970-01-01 00:00:00.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/main/java/module-info.java	2019-10-04 18:54:03.000000000 +0000
@@ -0,0 +1,12 @@
+/**
+ * Defines the Gson serialization/deserialization API.
+ * @since 2.8.6
+ */
+module com.google.gson {
+	exports com.google.gson;
+	exports com.google.gson.annotations;
+	exports com.google.gson.reflect;
+	exports com.google.gson.stream;
+
+	requires transitive java.sql;
+}
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/common/MoreAsserts.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/common/MoreAsserts.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/common/MoreAsserts.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/common/MoreAsserts.java	2019-10-04 18:54:03.000000000 +0000
@@ -16,7 +16,7 @@
 
 package com.google.gson.common;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import java.util.Collection;
 
@@ -28,26 +28,6 @@
  */
 public class MoreAsserts {
 
-  public static void assertEquals(int[] expected, int[] target) {
-    if (expected == null) {
-      Assert.assertNull(target);
-    }
-    Assert.assertEquals(expected.length, target.length);
-    for (int i = 0; i < expected.length; ++i) {
-      Assert.assertEquals(expected[i], target[i]);
-    }
-  }
-
-  public static void assertEquals(Integer[] expected, Integer[] target) {
-    if (expected == null) {
-      Assert.assertNull(target);
-    }
-    Assert.assertEquals(expected.length, target.length);
-    for (int i = 0; i < expected.length; ++i) {
-      Assert.assertEquals(expected[i], target[i]);
-    }
-  }
-
   /**
    * Asserts that the specified {@code value} is not present in {@code collection}
    * @param collection the collection to look into
@@ -69,5 +49,4 @@
     Assert.assertFalse(a.equals(null));
     Assert.assertFalse(a.equals(new Object()));
   }
-
 }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/DefaultDateTypeAdapterTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/DefaultDateTypeAdapterTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/DefaultDateTypeAdapterTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/DefaultDateTypeAdapterTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -88,8 +88,9 @@
           new DefaultDateTypeAdapter(DateFormat.MEDIUM, DateFormat.MEDIUM));
       assertParsed(String.format("1 janvier 1970%s00:00:00 UTC", afterYearSep),
           new DefaultDateTypeAdapter(DateFormat.LONG, DateFormat.LONG));
-      assertParsed(JavaVersion.isJava9OrLater() ?
+      assertParsed(JavaVersion.isJava9OrLater() ? (JavaVersion.getMajorJavaVersion() <11 ?
                       "jeudi 1 janvier 1970 à 00:00:00 Coordinated Universal Time" :
+                      "jeudi 1 janvier 1970 à 00:00:00 Temps universel coordonné") :
                       "jeudi 1 janvier 1970 00 h 00 UTC",
           new DefaultDateTypeAdapter(DateFormat.FULL, DateFormat.FULL));
     } finally {
@@ -167,6 +168,7 @@
     assertEquals(toLiteral(formatter.format(currentDate)), dateString);
   }
 
+  @SuppressWarnings("unused")
   public void testInvalidDatePattern() throws Exception {
     try {
       new DefaultDateTypeAdapter(Date.class, "I am a bad Date pattern....");
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/FieldAttributesTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/FieldAttributesTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/FieldAttributesTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/FieldAttributesTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -39,6 +39,7 @@
     fieldAttributes = new FieldAttributes(Foo.class.getField("bar"));
   }
 
+  @SuppressWarnings("unused")
   public void testNullField() throws Exception {
     try {
       new FieldAttributes(null);
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/ArrayTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/ArrayTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/ArrayTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/ArrayTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -19,12 +19,12 @@
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonParseException;
-import com.google.gson.common.MoreAsserts;
 import com.google.gson.common.TestTypes.BagOfPrimitives;
 import com.google.gson.common.TestTypes.ClassWithObjects;
 import com.google.gson.reflect.TypeToken;
 
 import junit.framework.TestCase;
+import static org.junit.Assert.assertArrayEquals;
 
 import java.lang.reflect.Type;
 import java.math.BigDecimal;
@@ -53,7 +53,7 @@
   public void testTopLevelArrayOfIntsDeserialization() {
     int[] expected = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
     int[] actual = gson.fromJson("[1,2,3,4,5,6,7,8,9]", int[].class);
-    MoreAsserts.assertEquals(expected, actual);
+    assertArrayEquals(expected, actual);
   }
 
   public void testInvalidArrayDeserialization() {
@@ -173,8 +173,8 @@
     Collection[] target = gson.fromJson(json, type);
 
     assertEquals(2, target.length);
-    MoreAsserts.assertEquals(new Integer[] { 1, 2 }, target[0].toArray(new Integer[0]));
-    MoreAsserts.assertEquals(new Integer[] { 3, 4 }, target[1].toArray(new Integer[0]));
+    assertArrayEquals(new Integer[] { 1, 2 }, target[0].toArray(new Integer[0]));
+    assertArrayEquals(new Integer[] { 3, 4 }, target[1].toArray(new Integer[0]));
   }
 
   public void testArrayOfPrimitivesAsObjectsSerialization() throws Exception {
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/CollectionTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/CollectionTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/CollectionTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/CollectionTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -42,6 +42,7 @@
 import com.google.gson.reflect.TypeToken;
 
 import junit.framework.TestCase;
+import static org.junit.Assert.assertArrayEquals;
 
 /**
  * Functional tests for Json serialization and deserialization of collections.
@@ -70,7 +71,7 @@
     Type collectionType = new TypeToken>() { }.getType();
     Collection target = gson.fromJson(json, collectionType);
     int[] expected = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-    MoreAsserts.assertEquals(expected, toIntArray(target));
+    assertArrayEquals(expected, toIntArray(target));
   }
 
   public void testTopLevelListOfIntegerCollectionsDeserialization() throws Exception {
@@ -86,7 +87,7 @@
     }
 
     for (int i = 0; i < 3; i++) {
-      MoreAsserts.assertEquals(expected[i], toIntArray(target.get(i)));
+      assertArrayEquals(expected[i], toIntArray(target.get(i)));
     }
   }
 
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/CustomDeserializerTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/CustomDeserializerTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/CustomDeserializerTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/CustomDeserializerTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -31,7 +31,7 @@
 import java.lang.reflect.Type;
 
 /**
- * Functional Test exercising custom deserialization only.  When test applies to both
+ * Functional Test exercising custom deserialization only. When test applies to both
  * serialization and deserialization then add it to CustomTypeAdapterTest.
  *
  * @author Joel Leitch
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -87,20 +87,20 @@
 
   public void testClassSerialization() {
     try {
-      gson.toJson(String.class);  
+      gson.toJson(String.class);
     } catch (UnsupportedOperationException expected) {}
     // Override with a custom type adapter for class.
     gson = new GsonBuilder().registerTypeAdapter(Class.class, new MyClassTypeAdapter()).create();
-    assertEquals("\"java.lang.String\"", gson.toJson(String.class));  
+    assertEquals("\"java.lang.String\"", gson.toJson(String.class));
   }
 
   public void testClassDeserialization() {
     try {
-      gson.fromJson("String.class", String.class.getClass());  
+      gson.fromJson("String.class", String.class.getClass());
     } catch (UnsupportedOperationException expected) {}
     // Override with a custom type adapter for class.
     gson = new GsonBuilder().registerTypeAdapter(Class.class, new MyClassTypeAdapter()).create();
-    assertEquals(String.class, gson.fromJson("java.lang.String", Class.class));  
+    assertEquals(String.class, gson.fromJson("java.lang.String", Class.class));
   }
 
   public void testUrlSerialization() throws Exception {
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/FieldNamingTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/FieldNamingTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/FieldNamingTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/FieldNamingTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -33,7 +33,7 @@
     Gson gson = getGsonWithNamingPolicy(IDENTITY);
     assertEquals("{'lowerCamel':1,'UpperCamel':2,'_lowerCamelLeadingUnderscore':3," +
         "'_UpperCamelLeadingUnderscore':4,'lower_words':5,'UPPER_WORDS':6," +
-        "'annotatedName':7,'lowerId':8}",
+        "'annotatedName':7,'lowerId':8,'_9':9}",
         gson.toJson(new TestNames()).replace('\"', '\''));
   }
 
@@ -41,7 +41,7 @@
     Gson gson = getGsonWithNamingPolicy(UPPER_CAMEL_CASE);
     assertEquals("{'LowerCamel':1,'UpperCamel':2,'_LowerCamelLeadingUnderscore':3," +
         "'_UpperCamelLeadingUnderscore':4,'Lower_words':5,'UPPER_WORDS':6," +
-        "'annotatedName':7,'LowerId':8}",
+        "'annotatedName':7,'LowerId':8,'_9':9}",
         gson.toJson(new TestNames()).replace('\"', '\''));
   }
 
@@ -49,7 +49,7 @@
     Gson gson = getGsonWithNamingPolicy(UPPER_CAMEL_CASE_WITH_SPACES);
     assertEquals("{'Lower Camel':1,'Upper Camel':2,'_Lower Camel Leading Underscore':3," +
         "'_ Upper Camel Leading Underscore':4,'Lower_words':5,'U P P E R_ W O R D S':6," +
-        "'annotatedName':7,'Lower Id':8}",
+        "'annotatedName':7,'Lower Id':8,'_9':9}",
         gson.toJson(new TestNames()).replace('\"', '\''));
   }
 
@@ -57,7 +57,7 @@
     Gson gson = getGsonWithNamingPolicy(LOWER_CASE_WITH_UNDERSCORES);
     assertEquals("{'lower_camel':1,'upper_camel':2,'_lower_camel_leading_underscore':3," +
         "'__upper_camel_leading_underscore':4,'lower_words':5,'u_p_p_e_r__w_o_r_d_s':6," +
-        "'annotatedName':7,'lower_id':8}",
+        "'annotatedName':7,'lower_id':8,'_9':9}",
         gson.toJson(new TestNames()).replace('\"', '\''));
   }
 
@@ -65,7 +65,7 @@
     Gson gson = getGsonWithNamingPolicy(LOWER_CASE_WITH_DASHES);
     assertEquals("{'lower-camel':1,'upper-camel':2,'_lower-camel-leading-underscore':3," +
         "'_-upper-camel-leading-underscore':4,'lower_words':5,'u-p-p-e-r_-w-o-r-d-s':6," +
-        "'annotatedName':7,'lower-id':8}",
+        "'annotatedName':7,'lower-id':8,'_9':9}",
         gson.toJson(new TestNames()).replace('\"', '\''));
   }
 
@@ -85,5 +85,6 @@
     int UPPER_WORDS = 6;
     @SerializedName("annotatedName") int annotated = 7;
     int lowerId = 8;
+    int _9 = 9;
   }
 }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/InheritanceTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/InheritanceTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/InheritanceTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/InheritanceTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -217,7 +217,7 @@
           return false;
         }
       }
-      return true;      
+      return true;
     }
     
     boolean setContains(float... values) {
@@ -235,7 +235,7 @@
           return false;
         }
       }
-      return true;      
+      return true;
     }
     
     public String getExpectedJson() {
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/InstanceCreatorTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/InstanceCreatorTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/InstanceCreatorTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/InstanceCreatorTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -33,7 +33,7 @@
 import java.util.TreeSet;
 
 /**
- * Functional Test exercising custom serialization only.  When test applies to both
+ * Functional Test exercising custom serialization only. When test applies to both
  * serialization and deserialization then add it to CustomTypeAdapterTest.
  *
  * @author Inderjeet Singh
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/JsonParserTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/JsonParserTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/JsonParserTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/JsonParserTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -112,7 +112,7 @@
   public void testChangingCustomTreeAndDeserializing() {
     StringReader json =
       new StringReader("{'stringValue':'no message','intValue':10,'longValue':20}");
-    JsonObject obj = (JsonObject) new JsonParser().parse(json);
+    JsonObject obj = (JsonObject) JsonParser.parseReader(json);
     obj.remove("stringValue");
     obj.addProperty("stringValue", "fooBar");
     BagOfPrimitives target = gson.fromJson(obj, BagOfPrimitives.class);
@@ -123,9 +123,9 @@
 
   public void testExtraCommasInArrays() {
     Type type = new TypeToken>() {}.getType();
-    assertEquals(list("a", null, "b", null, null), gson.fromJson("[a,,b,,]", type));
-    assertEquals(list(null, null), gson.fromJson("[,]", type));
-    assertEquals(list("a", null), gson.fromJson("[a,]", type));
+    assertEquals(Arrays.asList("a", null, "b", null, null), gson.fromJson("[a,,b,,]", type));
+    assertEquals(Arrays.asList(null, null), gson.fromJson("[,]", type));
+    assertEquals(Arrays.asList("a", null), gson.fromJson("[a,]", type));
   }
 
   public void testExtraCommasInMaps() {
@@ -136,8 +136,4 @@
     } catch (JsonSyntaxException expected) {
     }
   }
-
-  private  List list(T... elements) {
-    return Arrays.asList(elements);
-  }
 }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/MapAsArrayTypeAdapterTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/MapAsArrayTypeAdapterTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/MapAsArrayTypeAdapterTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/MapAsArrayTypeAdapterTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -59,8 +59,8 @@
         .create();
 
     Map original = new LinkedHashMap();
-    original.put(new Double(1.0), "a");
-    original.put(new Float(1.0), "b");
+    original.put(1.0D, "a");
+    original.put(1.0F, "b");
     try {
       gson.toJson(original, new TypeToken>() {}.getType());
       fail(); // we no longer hash keys at serialization time
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/MapTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/MapTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/MapTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/MapTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -364,7 +364,7 @@
     Type typeOfMap = new TypeToken>() {}.getType();
     Map map = gson.fromJson("{\"test\":123}", typeOfMap);
     assertEquals(1, map.size());
-    assertEquals(new Long(123L), map.get("test"));
+    assertEquals(Long.valueOf(123L), map.get("test"));
   }
 
 
@@ -608,7 +608,7 @@
     String json = "{'2.3':'a'}";
     Map map = new LinkedHashMap();
     map.put(2.3, "a");
-    JsonElement tree = new JsonParser().parse(json);
+    JsonElement tree = JsonParser.parseString(json);
     assertEquals(map, gson.fromJson(tree, new TypeToken>() {}.getType()));
   }
 
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/NullObjectAndFieldTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/NullObjectAndFieldTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/NullObjectAndFieldTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/NullObjectAndFieldTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -163,7 +163,7 @@
     assertFalse(target.bool2); // test the default value of a primitive boolean field per JVM spec
   }
 
-  public static class ClassWithInitializedMembers  {
+  public static class ClassWithInitializedMembers {
     // Using a mix of no-args constructor and field initializers
     // Also, some fields are intialized and some are not (so initialized per JVM spec)
     public static final String MY_STRING_DEFAULT = "string";
@@ -204,7 +204,7 @@
     Gson gson = new Gson();
     String json = "{value:null}";
     ObjectWithField obj = gson.fromJson(json, ObjectWithField.class);
-    assertNull(obj.value);    
+    assertNull(obj.value);
   }
 
   public void testCustomTypeAdapterPassesNullSerialization() {
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/ParameterizedTypesTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/ParameterizedTypesTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/ParameterizedTypesTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/ParameterizedTypesTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -121,7 +121,7 @@
         .registerTypeAdapter(ptStringType, new MyParameterizedTypeAdapter())
         .registerTypeAdapter(ptStringType, new MyParameterizedTypeInstanceCreator(""))
         .registerTypeAdapter(ptIntegerType,
-            new MyParameterizedTypeInstanceCreator(new Integer(0)))
+            new MyParameterizedTypeInstanceCreator(0))
         .create();
 
     MyParameterizedType src = new MyParameterizedType(10);
@@ -472,11 +472,11 @@
     @SuppressWarnings("unused")
     int q2 = 20;
   }
-  private interface Measurable {    
+  private interface Measurable {
   }
-  private interface Field {    
+  private interface Field {
   }
-  private interface Immutable {    
+  private interface Immutable {
   }
   
   public static final class Amount 
@@ -490,12 +490,12 @@
     Amount amount = new Amount();
     String json = gson.toJson(amount);
     assertTrue(json.contains("value"));
-    assertTrue(json.contains("30"));    
+    assertTrue(json.contains("30"));
   }
   
   public void testDeepParameterizedTypeDeserialization() {
     String json = "{value:30}";
-    Type type = new TypeToken>() {}.getType();    
+    Type type = new TypeToken>() {}.getType();
     Amount amount = gson.fromJson(json, type);
     assertEquals(30, amount.value);
   }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/PrimitiveTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/PrimitiveTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/PrimitiveTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/PrimitiveTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -144,12 +144,12 @@
 
   public void testNumberDeserialization() {
     String json = "1";
-    Number expected = new Integer(json);
+    Number expected = Integer.valueOf(json);
     Number actual = gson.fromJson(json, Number.class);
     assertEquals(expected.intValue(), actual.intValue());
 
     json = String.valueOf(Long.MAX_VALUE);
-    expected = new Long(json);
+    expected = Long.valueOf(json);
     actual = gson.fromJson(json, Number.class);
     assertEquals(expected.longValue(), actual.longValue());
 
@@ -164,16 +164,16 @@
   }
 
   public void testPrimitiveDoubleAutoboxedSerialization() {
-    assertEquals("-122.08234335", gson.toJson(-122.08234335));
-    assertEquals("122.08112002", gson.toJson(new Double(122.08112002)));
+    assertEquals("-122.08234335", gson.toJson(-122.08234335D));
+    assertEquals("122.08112002", gson.toJson(122.08112002D));
   }
 
   public void testPrimitiveDoubleAutoboxedDeserialization() {
     double actual = gson.fromJson("-122.08858585", double.class);
-    assertEquals(-122.08858585, actual);
+    assertEquals(-122.08858585D, actual);
 
     actual = gson.fromJson("122.023900008000", Double.class);
-    assertEquals(122.023900008, actual);
+    assertEquals(122.023900008D, actual);
   }
 
   public void testPrimitiveDoubleAutoboxedInASingleElementArraySerialization() {
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/VersioningTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/VersioningTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/functional/VersioningTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/functional/VersioningTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -88,7 +88,7 @@
   public void testIgnoreLaterVersionClassDeserialization() {
     Gson gson = builder.setVersion(1.0).create();
     String json = "{\"a\":3,\"b\":4,\"c\":5,\"d\":6}";
-    Version1_2 version1_2  = gson.fromJson(json, Version1_2.class);
+    Version1_2 version1_2 = gson.fromJson(json, Version1_2.class);
     // Since the class is versioned to be after 1.0, we expect null
     // This is the new behavior in Gson 2.0
     assertNull(version1_2);
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/bind/JsonElementReaderTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/bind/JsonElementReaderTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/bind/JsonElementReaderTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/bind/JsonElementReaderTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -26,7 +26,7 @@
 public final class JsonElementReaderTest extends TestCase {
 
   public void testNumbers() throws IOException {
-    JsonElement element = new JsonParser().parse("[1, 2, 3]");
+    JsonElement element = JsonParser.parseString("[1, 2, 3]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     assertEquals(1, reader.nextInt());
@@ -36,7 +36,7 @@
   }
 
   public void testLenientNansAndInfinities() throws IOException {
-    JsonElement element = new JsonParser().parse("[NaN, -Infinity, Infinity]");
+    JsonElement element = JsonParser.parseString("[NaN, -Infinity, Infinity]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.setLenient(true);
     reader.beginArray();
@@ -47,7 +47,7 @@
   }
 
   public void testStrictNansAndInfinities() throws IOException {
-    JsonElement element = new JsonParser().parse("[NaN, -Infinity, Infinity]");
+    JsonElement element = JsonParser.parseString("[NaN, -Infinity, Infinity]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.setLenient(false);
     reader.beginArray();
@@ -73,7 +73,7 @@
   }
 
   public void testNumbersFromStrings() throws IOException {
-    JsonElement element = new JsonParser().parse("[\"1\", \"2\", \"3\"]");
+    JsonElement element = JsonParser.parseString("[\"1\", \"2\", \"3\"]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     assertEquals(1, reader.nextInt());
@@ -83,7 +83,7 @@
   }
 
   public void testStringsFromNumbers() throws IOException {
-    JsonElement element = new JsonParser().parse("[1]");
+    JsonElement element = JsonParser.parseString("[1]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     assertEquals("1", reader.nextString());
@@ -91,7 +91,7 @@
   }
 
   public void testBooleans() throws IOException {
-    JsonElement element = new JsonParser().parse("[true, false]");
+    JsonElement element = JsonParser.parseString("[true, false]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     assertEquals(true, reader.nextBoolean());
@@ -100,7 +100,7 @@
   }
 
   public void testNulls() throws IOException {
-    JsonElement element = new JsonParser().parse("[null,null]");
+    JsonElement element = JsonParser.parseString("[null,null]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     reader.nextNull();
@@ -109,7 +109,7 @@
   }
 
   public void testStrings() throws IOException {
-    JsonElement element = new JsonParser().parse("[\"A\",\"B\"]");
+    JsonElement element = JsonParser.parseString("[\"A\",\"B\"]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     assertEquals("A", reader.nextString());
@@ -118,7 +118,7 @@
   }
 
   public void testArray() throws IOException {
-    JsonElement element = new JsonParser().parse("[1, 2, 3]");
+    JsonElement element = JsonParser.parseString("[1, 2, 3]");
     JsonTreeReader reader = new JsonTreeReader(element);
     assertEquals(JsonToken.BEGIN_ARRAY, reader.peek());
     reader.beginArray();
@@ -134,7 +134,7 @@
   }
 
   public void testObject() throws IOException {
-    JsonElement element = new JsonParser().parse("{\"A\": 1, \"B\": 2}");
+    JsonElement element = JsonParser.parseString("{\"A\": 1, \"B\": 2}");
     JsonTreeReader reader = new JsonTreeReader(element);
     assertEquals(JsonToken.BEGIN_OBJECT, reader.peek());
     reader.beginObject();
@@ -152,14 +152,14 @@
   }
 
   public void testEmptyArray() throws IOException {
-    JsonElement element = new JsonParser().parse("[]");
+    JsonElement element = JsonParser.parseString("[]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     reader.endArray();
   }
 
   public void testNestedArrays() throws IOException {
-    JsonElement element = new JsonParser().parse("[[],[[]]]");
+    JsonElement element = JsonParser.parseString("[[],[[]]]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     reader.beginArray();
@@ -172,7 +172,7 @@
   }
 
   public void testNestedObjects() throws IOException {
-    JsonElement element = new JsonParser().parse("{\"A\":{},\"B\":{\"C\":{}}}");
+    JsonElement element = JsonParser.parseString("{\"A\":{},\"B\":{\"C\":{}}}");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginObject();
     assertEquals("A", reader.nextName());
@@ -188,14 +188,14 @@
   }
 
   public void testEmptyObject() throws IOException {
-    JsonElement element = new JsonParser().parse("{}");
+    JsonElement element = JsonParser.parseString("{}");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginObject();
     reader.endObject();
   }
 
   public void testSkipValue() throws IOException {
-    JsonElement element = new JsonParser().parse("[\"A\",{\"B\":[[]]},\"C\",[[]],\"D\",null]");
+    JsonElement element = JsonParser.parseString("[\"A\",{\"B\":[[]]},\"C\",[[]],\"D\",null]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     assertEquals("A", reader.nextString());
@@ -208,7 +208,7 @@
   }
 
   public void testWrongType() throws IOException {
-    JsonElement element = new JsonParser().parse("[[],\"A\"]");
+    JsonElement element = JsonParser.parseString("[[],\"A\"]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     try {
@@ -299,7 +299,7 @@
   }
 
   public void testEarlyClose() throws IOException {
-    JsonElement element = new JsonParser().parse("[1, 2, 3]");
+    JsonElement element = JsonParser.parseString("[1, 2, 3]");
     JsonTreeReader reader = new JsonTreeReader(element);
     reader.beginArray();
     reader.close();
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/bind/JsonTreeWriterTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/bind/JsonTreeWriterTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/bind/JsonTreeWriterTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/bind/JsonTreeWriterTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -157,17 +157,17 @@
     writer.setLenient(false);
     writer.beginArray();
     try {
-      writer.value(new Double(Double.NaN));
+      writer.value(Double.valueOf(Double.NaN));
       fail();
     } catch (IllegalArgumentException expected) {
     }
     try {
-      writer.value(new Double(Double.NEGATIVE_INFINITY));
+      writer.value(Double.valueOf(Double.NEGATIVE_INFINITY));
       fail();
     } catch (IllegalArgumentException expected) {
     }
     try {
-      writer.value(new Double(Double.POSITIVE_INFINITY));
+      writer.value(Double.valueOf(Double.POSITIVE_INFINITY));
       fail();
     } catch (IllegalArgumentException expected) {
     }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/bind/RecursiveTypesResolveTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/bind/RecursiveTypesResolveTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/bind/RecursiveTypesResolveTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/bind/RecursiveTypesResolveTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -34,10 +34,11 @@
  */
 public class RecursiveTypesResolveTest extends TestCase {
 
+  @SuppressWarnings("unused")
   private static class Foo1 {
-    public Foo2 foo2;
+	public Foo2 foo2;
   }
-
+  @SuppressWarnings("unused")
   private static class Foo2 {
     public Foo1 foo1;
   }
@@ -45,14 +46,16 @@
   /**
    * Test simplest case of recursion.
    */
+
   public void testRecursiveResolveSimple() {
     TypeAdapter adapter = new Gson().getAdapter(Foo1.class);
     assertNotNull(adapter);
   }
 
-  //
-  // Real-world samples, found in Issues #603 and #440.
-  //
+  /**
+   * Real-world samples, found in Issues #603 and #440.
+   */
+
   public void testIssue603PrintStream() {
     TypeAdapter adapter = new Gson().getAdapter(PrintStream.class);
     assertNotNull(adapter);
@@ -63,9 +66,9 @@
     assertNotNull(adapter);
   }
 
-  //
-  // Tests belows check the behaviour of the methods changed for the fix
-  //
+  /**
+   * Tests belows check the behaviour of the methods changed for the fix.
+   */
 
   public void testDoubleSupertype() {
     assertEquals($Gson$Types.supertypeOf(Number.class),
@@ -87,14 +90,16 @@
             $Gson$Types.subtypeOf($Gson$Types.supertypeOf(Number.class)));
   }
 
-  //
-  // tests for recursion while resolving type variables
-  //
+  /**
+   * Tests for recursion while resolving type variables.
+   */
 
+  @SuppressWarnings("unused")
   private static class TestType {
     TestType superType;
   }
 
+  @SuppressWarnings("unused")
   private static class TestType2 {
     TestType2 superReversedType;
   }
@@ -109,6 +114,3 @@
     assertNotNull(adapter);
   }
 }
-
-
-
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/UnsafeAllocatorInstantiationTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/UnsafeAllocatorInstantiationTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/internal/UnsafeAllocatorInstantiationTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/internal/UnsafeAllocatorInstantiationTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -33,7 +33,7 @@
   }
 
   /**
-   * Ensure that the {@link java.lang.UnsupportedOperationException} is thrown when  trying
+   * Ensure that the {@link java.lang.UnsupportedOperationException} is thrown when trying
    * to instantiate an interface
    */
   public void testInterfaceInstantiation() {
@@ -47,7 +47,7 @@
   }
 
   /**
-   * Ensure that the {@link java.lang.UnsupportedOperationException} is thrown when  trying
+   * Ensure that the {@link java.lang.UnsupportedOperationException} is thrown when trying
    * to instantiate an abstract class
    */
   public void testAbstractClassInstantiation() {
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/JsonObjectTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/JsonObjectTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/JsonObjectTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/JsonObjectTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -128,7 +128,7 @@
   }
 
   public void testReadPropertyWithEmptyStringName() {
-    JsonObject jsonObj = new JsonParser().parse("{\"\":true}").getAsJsonObject();
+    JsonObject jsonObj = JsonParser.parseString("{\"\":true}").getAsJsonObject();
     assertEquals(true, jsonObj.get("").getAsBoolean());
   }
 
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/JsonParserTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/JsonParserTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/JsonParserTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/JsonParserTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -32,23 +32,16 @@
  * @author Inderjeet Singh
  */
 public class JsonParserTest extends TestCase {
-  private JsonParser parser;
-
-  @Override
-  protected void setUp() throws Exception {
-    super.setUp();
-    parser = new JsonParser();
-  }
 
   public void testParseInvalidJson() {
     try {
-      parser.parse("[[]");
+      JsonParser.parseString("[[]");
       fail();
     } catch (JsonSyntaxException expected) { }
   }
 
   public void testParseUnquotedStringArrayFails() {
-    JsonElement element = parser.parse("[a,b,c]");
+    JsonElement element = JsonParser.parseString("[a,b,c]");
     assertEquals("a", element.getAsJsonArray().get(0).getAsString());
     assertEquals("b", element.getAsJsonArray().get(1).getAsString());
     assertEquals("c", element.getAsJsonArray().get(2).getAsString());
@@ -57,38 +50,38 @@
 
   public void testParseString() {
     String json = "{a:10,b:'c'}";
-    JsonElement e = parser.parse(json);
+    JsonElement e = JsonParser.parseString(json);
     assertTrue(e.isJsonObject());
     assertEquals(10, e.getAsJsonObject().get("a").getAsInt());
     assertEquals("c", e.getAsJsonObject().get("b").getAsString());
   }
 
   public void testParseEmptyString() {
-    JsonElement e = parser.parse("\"   \"");
+    JsonElement e = JsonParser.parseString("\"   \"");
     assertTrue(e.isJsonPrimitive());
     assertEquals("   ", e.getAsString());
   }
 
   public void testParseEmptyWhitespaceInput() {
-    JsonElement e = parser.parse("     ");
+    JsonElement e = JsonParser.parseString("     ");
     assertTrue(e.isJsonNull());
   }
 
   public void testParseUnquotedSingleWordStringFails() {
-    assertEquals("Test", parser.parse("Test").getAsString());
+    assertEquals("Test", JsonParser.parseString("Test").getAsString());
   }
 
   public void testParseUnquotedMultiWordStringFails() {
     String unquotedSentence = "Test is a test..blah blah";
     try {
-      parser.parse(unquotedSentence);
+      JsonParser.parseString(unquotedSentence);
       fail();
     } catch (JsonSyntaxException expected) { }
   }
 
   public void testParseMixedArray() {
     String json = "[{},13,\"stringValue\"]";
-    JsonElement e = parser.parse(json);
+    JsonElement e = JsonParser.parseString(json);
     assertTrue(e.isJsonArray());
 
     JsonArray  array = e.getAsJsonArray();
@@ -99,7 +92,7 @@
 
   public void testParseReader() {
     StringReader reader = new StringReader("{a:10,b:'c'}");
-    JsonElement e = parser.parse(reader);
+    JsonElement e = JsonParser.parseReader(reader);
     assertTrue(e.isJsonObject());
     assertEquals(10, e.getAsJsonObject().get("a").getAsInt());
     assertEquals("c", e.getAsJsonObject().get("b").getAsString());
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/JsonPrimitiveTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/JsonPrimitiveTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/JsonPrimitiveTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/JsonPrimitiveTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -30,6 +30,30 @@
  */
 public class JsonPrimitiveTest extends TestCase {
 
+  @SuppressWarnings("unused")
+  public void testNulls() {
+    try {
+      new JsonPrimitive((Boolean) null);
+      fail();
+    } catch (NullPointerException ignored) {
+    }
+    try {
+      new JsonPrimitive((Number) null);
+      fail();
+    } catch (NullPointerException ignored) {
+    }
+    try {
+      new JsonPrimitive((String) null);
+      fail();
+    } catch (NullPointerException ignored) {
+    }
+    try {
+      new JsonPrimitive((Character) null);
+      fail();
+    } catch (NullPointerException ignored) {
+    }
+  }
+
   public void testBoolean() throws Exception {
     JsonPrimitive json = new JsonPrimitive(Boolean.TRUE);
 
@@ -90,8 +114,8 @@
     JsonPrimitive json = new JsonPrimitive("1E+7");
 
     assertEquals(new BigDecimal("1E+7"), json.getAsBigDecimal());
-    assertEquals(new Double("1E+7"), json.getAsDouble(), 0.00001);
-    assertEquals(new Float("1E+7"), json.getAsDouble(), 0.00001);
+    assertEquals(1E+7, json.getAsDouble(), 0.00001);
+    assertEquals(1E+7, json.getAsDouble(), 0.00001);
 
     try {
       json.getAsInt();
@@ -100,91 +124,91 @@
   }
 
   public void testByteEqualsShort() {
-    JsonPrimitive p1 = new JsonPrimitive(new Byte((byte)10));
-    JsonPrimitive p2 = new JsonPrimitive(new Short((short)10));
+    JsonPrimitive p1 = new JsonPrimitive(Byte.valueOf((byte)10));
+    JsonPrimitive p2 = new JsonPrimitive(Short.valueOf((short)10));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testByteEqualsInteger() {
-    JsonPrimitive p1 = new JsonPrimitive(new Byte((byte)10));
-    JsonPrimitive p2 = new JsonPrimitive(new Integer(10));
+    JsonPrimitive p1 = new JsonPrimitive(Byte.valueOf((byte)10));
+    JsonPrimitive p2 = new JsonPrimitive(Integer.valueOf(10));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testByteEqualsLong() {
-    JsonPrimitive p1 = new JsonPrimitive(new Byte((byte)10));
-    JsonPrimitive p2 = new JsonPrimitive(new Long(10L));
+    JsonPrimitive p1 = new JsonPrimitive(Byte.valueOf((byte)10));
+    JsonPrimitive p2 = new JsonPrimitive(Long.valueOf(10L));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testByteEqualsBigInteger() {
-    JsonPrimitive p1 = new JsonPrimitive(new Byte((byte)10));
+    JsonPrimitive p1 = new JsonPrimitive(Byte.valueOf((byte)10));
     JsonPrimitive p2 = new JsonPrimitive(new BigInteger("10"));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testShortEqualsInteger() {
-    JsonPrimitive p1 = new JsonPrimitive(new Short((short)10));
-    JsonPrimitive p2 = new JsonPrimitive(new Integer(10));
+    JsonPrimitive p1 = new JsonPrimitive(Short.valueOf((short)10));
+    JsonPrimitive p2 = new JsonPrimitive(Integer.valueOf(10));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testShortEqualsLong() {
-    JsonPrimitive p1 = new JsonPrimitive(new Short((short)10));
-    JsonPrimitive p2 = new JsonPrimitive(new Long(10));
+    JsonPrimitive p1 = new JsonPrimitive(Short.valueOf((short)10));
+    JsonPrimitive p2 = new JsonPrimitive(Long.valueOf(10));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testShortEqualsBigInteger() {
-    JsonPrimitive p1 = new JsonPrimitive(new Short((short)10));
+    JsonPrimitive p1 = new JsonPrimitive(Short.valueOf((short)10));
     JsonPrimitive p2 = new JsonPrimitive(new BigInteger("10"));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testIntegerEqualsLong() {
-    JsonPrimitive p1 = new JsonPrimitive(new Integer(10));
-    JsonPrimitive p2 = new JsonPrimitive(new Long(10L));
+    JsonPrimitive p1 = new JsonPrimitive(Integer.valueOf(10));
+    JsonPrimitive p2 = new JsonPrimitive(Long.valueOf(10L));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testIntegerEqualsBigInteger() {
-    JsonPrimitive p1 = new JsonPrimitive(new Integer(10));
+    JsonPrimitive p1 = new JsonPrimitive(Integer.valueOf(10));
     JsonPrimitive p2 = new JsonPrimitive(new BigInteger("10"));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testLongEqualsBigInteger() {
-    JsonPrimitive p1 = new JsonPrimitive(new Long(10L));
+    JsonPrimitive p1 = new JsonPrimitive(Long.valueOf(10L));
     JsonPrimitive p2 = new JsonPrimitive(new BigInteger("10"));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testFloatEqualsDouble() {
-    JsonPrimitive p1 = new JsonPrimitive(new Float(10.25F));
-    JsonPrimitive p2 = new JsonPrimitive(new Double(10.25D));
+    JsonPrimitive p1 = new JsonPrimitive(Float.valueOf(10.25F));
+    JsonPrimitive p2 = new JsonPrimitive(Double.valueOf(10.25D));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testFloatEqualsBigDecimal() {
-    JsonPrimitive p1 = new JsonPrimitive(new Float(10.25F));
+    JsonPrimitive p1 = new JsonPrimitive(Float.valueOf(10.25F));
     JsonPrimitive p2 = new JsonPrimitive(new BigDecimal("10.25"));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
   }
 
   public void testDoubleEqualsBigDecimal() {
-    JsonPrimitive p1 = new JsonPrimitive(new Double(10.25D));
+    JsonPrimitive p1 = new JsonPrimitive(Double.valueOf(10.25D));
     JsonPrimitive p2 = new JsonPrimitive(new BigDecimal("10.25"));
     assertEquals(p1, p2);
     assertEquals(p1.hashCode(), p2.hashCode());
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/metrics/PerformanceTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/metrics/PerformanceTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/metrics/PerformanceTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/metrics/PerformanceTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -50,11 +50,11 @@
     gson = new Gson();
   }
   
-  public void testDummy() {    
+  public void testDummy() {
     // This is here to prevent Junit for complaining when we disable all tests.
-  }  
+  }
 
-  public void disabled_testStringDeserialization() {    
+  public void disabled_testStringDeserialization() {
     StringBuilder sb = new StringBuilder(8096);
     sb.append("Error Yippie");
 
@@ -138,8 +138,8 @@
     }    
     sb.append(']');
     String json = sb.toString();
-    Type collectionType = new TypeToken>(){}.getType();    
-    List list = gson.fromJson(json, collectionType);       
+    Type collectionType = new TypeToken>(){}.getType();
+    List list = gson.fromJson(json, collectionType);
     assertEquals(count, list.size());
   }
 
@@ -203,7 +203,7 @@
     } 
     long t2 = System.currentTimeMillis(); 
     long avg = (t2 - t1) / NUM_ITERATIONS;
-    System.out.printf("Serialize classes avg time: %d ms\n", avg);     
+    System.out.printf("Serialize classes avg time: %d ms\n", avg);
   }
 
   public void disabled_testDeserializeClasses() {
@@ -215,7 +215,7 @@
     }
     long t2 = System.currentTimeMillis(); 
     long avg = (t2 - t1) / NUM_ITERATIONS;
-    System.out.printf("Deserialize classes avg time: %d ms\n", avg);     
+    System.out.printf("Deserialize classes avg time: %d ms\n", avg);
   }
   
   public void disable_testLargeObjectSerializationAndDeserialization() {
@@ -249,7 +249,7 @@
     } 
     long t2 = System.currentTimeMillis(); 
     long avg = (t2 - t1) / NUM_ITERATIONS;
-    System.out.printf("Serialize exposed classes avg time: %d ms\n", avg);     
+    System.out.printf("Serialize exposed classes avg time: %d ms\n", avg);
   }
 
   public void disabled_testDeserializeExposedClasses() {
@@ -261,7 +261,7 @@
     }
     long t2 = System.currentTimeMillis(); 
     long avg = (t2 - t1) / NUM_ITERATIONS;
-    System.out.printf("Deserialize exposed classes avg time: %d ms\n", avg);     
+    System.out.printf("Deserialize exposed classes avg time: %d ms\n", avg);
   }
 
   public void disabled_testLargeGsonMapRoundTrip() throws Exception {
@@ -343,4 +343,4 @@
       this.field = field; 
     } 
   }
-}
+}
\ No newline at end of file
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/regression/JsonAdapterNullSafeTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/regression/JsonAdapterNullSafeTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/regression/JsonAdapterNullSafeTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/regression/JsonAdapterNullSafeTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -48,14 +48,13 @@
       // because we use it to return a null type adapter on a recursive call.
       private static final ThreadLocal recursiveCall = new ThreadLocal();
 
-      @SuppressWarnings({"unchecked", "rawtypes"})
       @Override public  TypeAdapter create(final Gson gson, TypeToken type) {
         if (type.getRawType() != Device.class || recursiveCall.get() != null) {
           recursiveCall.set(null); // clear for subsequent use
           return null;
         }
         recursiveCall.set(Boolean.TRUE);
-        return (TypeAdapter) gson.getDelegateAdapter(this, type);
+        return gson.getDelegateAdapter(this, type);
       }
     }
   }
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/stream/JsonReaderPathTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -27,9 +27,10 @@
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assume.assumeTrue;
 
+@SuppressWarnings("resource")
 @RunWith(Parameterized.class)
 public class JsonReaderPathTest {
   @Parameterized.Parameters(name = "{0}")
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/stream/JsonReaderTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/stream/JsonReaderTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/stream/JsonReaderTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/stream/JsonReaderTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -189,6 +189,7 @@
     }
   }
   
+  @SuppressWarnings("unused")
   public void testNulls() {
     try {
       new JsonReader(null);
diff -Nru libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/stream/JsonWriterTest.java libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/stream/JsonWriterTest.java
--- libgoogle-gson-java-2.8.5/gson/src/test/java/com/google/gson/stream/JsonWriterTest.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/gson/src/test/java/com/google/gson/stream/JsonWriterTest.java	2019-10-04 18:54:03.000000000 +0000
@@ -198,17 +198,17 @@
     JsonWriter jsonWriter = new JsonWriter(stringWriter);
     jsonWriter.beginArray();
     try {
-      jsonWriter.value(new Double(Double.NaN));
+      jsonWriter.value(Double.valueOf(Double.NaN));
       fail();
     } catch (IllegalArgumentException expected) {
     }
     try {
-      jsonWriter.value(new Double(Double.NEGATIVE_INFINITY));
+      jsonWriter.value(Double.valueOf(Double.NEGATIVE_INFINITY));
       fail();
     } catch (IllegalArgumentException expected) {
     }
     try {
-      jsonWriter.value(new Double(Double.POSITIVE_INFINITY));
+      jsonWriter.value(Double.valueOf(Double.POSITIVE_INFINITY));
       fail();
     } catch (IllegalArgumentException expected) {
     }
diff -Nru libgoogle-gson-java-2.8.5/metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java libgoogle-gson-java-2.8.6/metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java
--- libgoogle-gson-java-2.8.5/metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/metrics/src/main/java/com/google/gson/metrics/BagOfPrimitives.java	2019-10-04 18:54:03.000000000 +0000
@@ -66,25 +66,18 @@
 
   @Override
   public boolean equals(Object obj) {
-    if (this == obj)
-      return true;
-    if (obj == null)
-      return false;
-    if (getClass() != obj.getClass())
-      return false;
+    if (this == obj) return true;
+    if (obj == null) return false;
+    if (getClass() != obj.getClass()) return false;
     BagOfPrimitives other = (BagOfPrimitives) obj;
-    if (booleanValue != other.booleanValue)
-      return false;
-    if (intValue != other.intValue)
-      return false;
-    if (longValue != other.longValue)
-      return false;
+    if (booleanValue != other.booleanValue) return false;
+    if (intValue != other.intValue) return false;
+    if (longValue != other.longValue) return false;
     if (stringValue == null) {
-      if (other.stringValue != null)
-        return false;
-    } else if (!stringValue.equals(other.stringValue))
-      return false;
-    return true;
+      return other.stringValue == null;
+    } else {
+      return stringValue.equals(other.stringValue);
+    }
   }
 
   @Override
diff -Nru libgoogle-gson-java-2.8.5/pom.xml libgoogle-gson-java-2.8.6/pom.xml
--- libgoogle-gson-java-2.8.5/pom.xml	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/pom.xml	2019-10-04 18:54:03.000000000 +0000
@@ -11,7 +11,7 @@
 
   com.google.code.gson
   gson-parent
-  2.8.5
+  2.8.6
   pom
 
   Gson Parent
@@ -31,7 +31,7 @@
     https://github.com/google/gson/
     scm:git:https://github.com/google/gson.git
     scm:git:git@github.com:google/gson.git
-    gson-parent-2.8.5
+    gson-parent-2.8.6
   
 
   
@@ -63,13 +63,35 @@
         
           org.apache.maven.plugins
           maven-compiler-plugin
-          3.7.0
+          3.8.1
+          
+            
+              default-compile
+              
+                
+                  9
+                
+                9
+              
+            
+            
+              base-compile
+              
+                compile
+              
+              
+                
+                  module-info.java
+                
+              
+            
+          
           
-            
-              **/module-info.java
-            
-            ${java.version}
-            ${java.version}
+            
+              [1.5,9)
+            
+            1.6
+            1.6
           
         
         
diff -Nru libgoogle-gson-java-2.8.5/README.md libgoogle-gson-java-2.8.6/README.md
--- libgoogle-gson-java-2.8.5/README.md	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/README.md	2019-10-04 18:54:03.000000000 +0000
@@ -1,48 +1,48 @@
-# google-gson
-
-[![Build Status](https://travis-ci.org/google/gson.svg?branch=master)](https://travis-ci.org/google/gson)
-[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.google.code.gson/gson/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.google.code.gson/gson)
-[![Javadoc](https://javadoc-emblem.rhcloud.com/doc/com.google.code.gson/gson/badge.svg)](http://www.javadoc.io/doc/com.google.code.gson/gson)
+# Gson
 
 Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object.
 Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.
 
 There are a few open-source projects that can convert Java objects to JSON. However, most of them require that you place Java annotations in your classes; something that you can not do if you do not have access to the source-code. Most also do not fully support the use of Java Generics. Gson considers both of these as very important design goals.
 
-### Gson Goals
+### Goals
   * Provide simple `toJson()` and `fromJson()` methods to convert Java objects to JSON and vice-versa
   * Allow pre-existing unmodifiable objects to be converted to and from JSON
   * Extensive support of Java Generics
   * Allow custom representations for objects
   * Support arbitrarily complex objects (with deep inheritance hierarchies and extensive use of generic types)
 
-### Gson Download and Maven
-  * To use Gson in Android
+### Download
+
+Gradle:
 ```gradle
 dependencies {
-    implementation 'com.google.code.gson:gson:2.8.4'
+  implementation 'com.google.code.gson:gson:2.8.5'
 }
 ```
 
-  * [Gson Download](https://maven-badges.herokuapp.com/maven-central/com.google.code.gson/gson) downloads at Maven Central
-  * To use Gson with Maven
-  ```xml
+Maven:
+```xml
 
-    com.google.code.gson
-    gson
-    2.8.4
+  com.google.code.gson
+  gson
+  2.8.5
 
 ```
 
-### Gson Documentation
-  * Gson [API](http://www.javadoc.io/doc/com.google.code.gson/gson): Javadocs for the current Gson release
-  * Gson [user guide](https://github.com/google/gson/blob/master/UserGuide.md): This guide contains examples on how to use Gson in your code.
-  * Gson [Roadmap](https://github.com/google/gson/blob/master/CHANGELOG.md): Details of changes in the recent versions
-  * Gson [design document](https://github.com/google/gson/blob/master/GsonDesignDocument.md): This document discusses issues we faced while designing Gson. It also includes a comparison of Gson with other Java libraries that can be used for Json conversion
+[Gson jar downloads](https://maven-badges.herokuapp.com/maven-central/com.google.code.gson/gson) are available from Maven Central.
+
+[![Build Status](https://travis-ci.org/google/gson.svg?branch=master)](https://travis-ci.org/google/gson)
+
+### Documentation
+  * [API Javadoc](https://www.javadoc.io/doc/com.google.code.gson/gson): Documentation for the current release
+  * [User guide](https://github.com/google/gson/blob/master/UserGuide.md): This guide contains examples on how to use Gson in your code.
+  * [Change log](https://github.com/google/gson/blob/master/CHANGELOG.md): Changes in the recent versions
+  * [Design document](https://github.com/google/gson/blob/master/GsonDesignDocument.md): This document discusses issues we faced while designing Gson. It also includes a comparison of Gson with other Java libraries that can be used for Json conversion
 
-Please use the [google-gson Google group](http://groups.google.com/group/google-gson) to discuss Gson, or to post questions.
+Please use the 'gson' tag on StackOverflow or the [google-gson Google group](https://groups.google.com/group/google-gson) to discuss Gson or to post questions.
 
-### Gson-related Content Created by Third Parties
+### Related Content Created by Third Parties
   * [Gson Tutorial](http://www.studytrails.com/java/json/java-google-json-introduction.jsp) by `StudyTrails`
   * [Gson Tutorial Series](https://futurestud.io/tutorials/gson-getting-started-with-java-json-serialization-deserialization) by `Future Studio`
   * [Gson API Report](https://abi-laboratory.pro/java/tracker/timeline/gson/)
@@ -66,3 +66,7 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 ```
+
+### Disclaimer
+
+This is not an officially supported Google product.
diff -Nru libgoogle-gson-java-2.8.5/ReleaseProcess.md libgoogle-gson-java-2.8.6/ReleaseProcess.md
--- libgoogle-gson-java-2.8.5/ReleaseProcess.md	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/ReleaseProcess.md	2019-10-04 18:54:03.000000000 +0000
@@ -17,15 +17,15 @@
 
 1. Update the version in the [Using Gson with Maven2 page](https://github.com/google/gson/blob/master/UserGuide.md#TOC-Gson-With-Maven)
 1. Update [Gson Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md). Also, look at all bugs that were fixed and add a few lines describing what changed in the release.
-1. Create a post on the [Gson Discussion Forum](http://groups.google.com/group/google-gson)
-1. Update the release version in [Wikipedia](http://en.wikipedia.org/wiki/GSON) and update the current "stable" release.
+1. Create a post on the [Gson Discussion Forum](https://groups.google.com/group/google-gson)
+1. Update the release version in [Wikipedia](https://en.wikipedia.org/wiki/GSON) and update the current "stable" release.
 
 ## Configuring a machine for deployment to Sonatype Repository
 
-This section was borrowed heavily from [Doclava release process](http://code.google.com/p/doclava/wiki/ProcessRelease).
+This section was borrowed heavily from [Doclava release process](https://code.google.com/archive/p/doclava/wikis/ProcessRelease.wiki).
 
-1. Install/Configure GPG following this [guide](http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven/).
-1. [Create encrypted passwords](http://maven.apache.org/guides/mini/guide-encryption.html).
+1. Install/Configure GPG following this [guide](https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/).
+1. [Create encrypted passwords](https://maven.apache.org/guides/mini/guide-encryption.html).
 1. Create `~/.m2/settings.xml` similar to as described in [Doclava release process](https://code.google.com/p/doclava/wiki/ProcessRelease).
 1. Now for deploying a snapshot repository, use `mvn deploy`.
 
diff -Nru libgoogle-gson-java-2.8.5/.travis.yml libgoogle-gson-java-2.8.6/.travis.yml
--- libgoogle-gson-java-2.8.5/.travis.yml	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/.travis.yml	2019-10-04 18:54:03.000000000 +0000
@@ -1,8 +1,7 @@
 language: java
 
 jdk:
-  - openjdk7
-  - oraclejdk8
+  - oraclejdk9
 
 install: mvn -f gson install -DskipTests=true
 script: mvn -f gson test
diff -Nru libgoogle-gson-java-2.8.5/UserGuide.md libgoogle-gson-java-2.8.6/UserGuide.md
--- libgoogle-gson-java-2.8.5/UserGuide.md	2018-05-22 03:08:09.000000000 +0000
+++ libgoogle-gson-java-2.8.6/UserGuide.md	2019-10-04 18:54:03.000000000 +0000
@@ -74,7 +74,7 @@
 ## Using Gson with Gradle/Android
 ```
 dependencies {
-    compile 'com.google.code.gson:gson:2.8.4'
+    implementation 'com.google.code.gson:gson:2.8.5'
 }
 ```
 ## Using Gson with Maven
@@ -86,7 +86,7 @@
     
       com.google.code.gson
       gson
-      2.8.4
+      2.8.5
       compile
     
 
@@ -148,8 +148,8 @@
 * There is no need to use any annotations to indicate a field is to be included for serialization and deserialization. All fields in the current class (and from all super classes) are included by default.
 * If a field is marked transient, (by default) it is ignored and not included in the JSON serialization or deserialization.
 * This implementation handles nulls correctly.
-* While serializing, a null field is omitted from the output.
-* While deserializing, a missing entry in JSON results in setting the corresponding field in the object to its default value: null for object types, zero for numeric types, and false for booleans.
+  * While serializing, a null field is omitted from the output.
+  * While deserializing, a missing entry in JSON results in setting the corresponding field in the object to its default value: null for object types, zero for numeric types, and false for booleans.
 * If a field is _synthetic_, it is ignored and not included in JSON serialization or deserialization.
 * Fields corresponding to the outer classes in inner classes, anonymous classes, and local classes are ignored and not included in serialization or deserialization.
 
@@ -248,9 +248,9 @@
 gson.fromJson(json, foo.getClass()); // Fails to deserialize foo.value as Bar
 ```
 
-The above code fails to interpret value as type Bar because Gson invokes `list.getClass()` to get its class information, but this method returns a raw class, `Foo.class`. This means that Gson has no way of knowing that this is an object of type `Foo`, and not just plain `Foo`.
+The above code fails to interpret value as type Bar because Gson invokes `foo.getClass()` to get its class information, but this method returns a raw class, `Foo.class`. This means that Gson has no way of knowing that this is an object of type `Foo`, and not just plain `Foo`.
 
-You can solve this problem by specifying the correct parameterized type for your generic type. You can do this by using the [`TypeToken`](http://google.github.io/gson/apidocs/com/google/gson/reflect/TypeToken.html) class.
+You can solve this problem by specifying the correct parameterized type for your generic type. You can do this by using the [`TypeToken`](https://static.javadoc.io/com.google.code.gson/gson/2.8.5/com/google/gson/reflect/TypeToken.html) class.
 
 ```java
 Type fooType = new TypeToken>() {}.getType();
@@ -510,12 +510,12 @@
 
 VersionedClass versionedObject = new VersionedClass();
 Gson gson = new GsonBuilder().setVersion(1.0).create();
-String jsonOutput = gson.toJson(someObject);
+String jsonOutput = gson.toJson(versionedObject);
 System.out.println(jsonOutput);
 System.out.println();
 
 gson = new Gson();
-jsonOutput = gson.toJson(someObject);
+jsonOutput = gson.toJson(versionedObject);
 System.out.println(jsonOutput);
 ```
 
@@ -556,7 +556,7 @@
 
 #### User Defined Exclusion Strategies
 
-If the above mechanisms for excluding fields and class type do not work for you then you can always write your own exclusion strategy and plug it into Gson. See the [`ExclusionStrategy`](http://google.github.io/gson/apidocs/com/google/gson/ExclusionStrategy.html) JavaDoc for more information.
+If the above mechanisms for excluding fields and class type do not work for you then you can always write your own exclusion strategy and plug it into Gson. See the [`ExclusionStrategy`](https://static.javadoc.io/com.google.code.gson/gson/2.8.5/com/google/gson/ExclusionStrategy.html) JavaDoc for more information.
 
 The following example shows how to exclude fields marked with a specific `@Foo` annotation and excludes top-level types (or declared field type) of class `String`.
 
@@ -615,7 +615,7 @@
 
 ### JSON Field Naming Support
 
-Gson supports some pre-defined field naming policies to convert the standard Java field names (i.e., camel cased names starting with lower case --- `sampleFieldNameInJava`) to a Json field name (i.e., `sample_field_name_in_java` or `SampleFieldNameInJava`). See the [FieldNamingPolicy](http://google.github.io/gson/apidocs/com/google/gson/FieldNamingPolicy.html) class for information on the pre-defined naming policies.
+Gson supports some pre-defined field naming policies to convert the standard Java field names (i.e., camel cased names starting with lower case --- `sampleFieldNameInJava`) to a Json field name (i.e., `sample_field_name_in_java` or `SampleFieldNameInJava`). See the [FieldNamingPolicy](https://static.javadoc.io/com.google.code.gson/gson/2.8.5/com/google/gson/FieldNamingPolicy.html) class for information on the pre-defined naming policies.
 
 It also has an annotation based strategy to allows clients to define custom names on a per field basis. Note, that the annotation based strategy has field name validation which will raise "Runtime" exceptions if an invalid field name is provided as the annotation value.
 
@@ -644,11 +644,11 @@
 {"custom_naming":"first","SomeOtherField":"second"}
 ```
 
-If you have a need for custom naming policy ([see this discussion](http://groups.google.com/group/google-gson/browse_thread/thread/cb441a2d717f6892)), you can use the [@SerializedName](http://google.github.io/gson/apidocs/com/google/gson/annotations/SerializedName.html) annotation.
+If you have a need for custom naming policy ([see this discussion](https://groups.google.com/group/google-gson/browse_thread/thread/cb441a2d717f6892)), you can use the [@SerializedName](https://static.javadoc.io/com.google.code.gson/gson/2.8.5/com/google/gson/annotations/SerializedName.html) annotation.
 
 ### Sharing State Across Custom Serializers and Deserializers
 
-Sometimes you need to share state across custom serializers/deserializers ([see this discussion](http://groups.google.com/group/google-gson/browse_thread/thread/2850010691ea09fb)). You can use the following three strategies to accomplish this:
+Sometimes you need to share state across custom serializers/deserializers ([see this discussion](https://groups.google.com/group/google-gson/browse_thread/thread/2850010691ea09fb)). You can use the following three strategies to accomplish this:
 
 1. Store shared state in static fields
 2. Declare the serializer/deserializer as inner classes of a parent type, and use the instance fields of parent type to store shared state