diff --git a/README.md b/README.md
index 351fed1bf8..a9ec0423f8 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ Maven:
![Build Status](https://github.com/google/gson/actions/workflows/build.yml/badge.svg)
### Requirements
-#### Java version
+#### Minimum Java version
- Gson 2.9.0 and newer: Java 7
- Gson 2.8.9 and older: Java 6
diff --git a/gson/pom.xml b/gson/pom.xml
index 1b1eb0d117..c1be6a920b 100644
--- a/gson/pom.xml
+++ b/gson/pom.xml
@@ -35,33 +35,18 @@
default-compile
-
-
- 9
-
- 9
-
-
-
- base-compile
-
- compile
-
+
module-info.java
-
-
- [1.5,9)
-
-
- 1.7
-
+
org.apache.maven.plugins
maven-surefire-plugin
@@ -82,11 +67,31 @@
maven-javadoc-plugin
com.google.gson.internal:com.google.gson.internal.bind
-
- https://docs.oracle.com/javase/7/docs/api/
-
+
+
+
+ org.moditect
+ moditect-maven-plugin
+ 1.0.0.RC2
+
+
+ add-module-info
+ package
+
+ add-module-info
+
+
+ 9
+
+ ${project.build.sourceDirectory}/module-info.java
+
+
+
+
+
biz.aQute.bnd
bnd-maven-plugin
@@ -104,6 +109,7 @@
maven-jar-plugin
+
${project.build.outputDirectory}/META-INF/MANIFEST.MF
diff --git a/gson/src/test/java/com/google/gson/functional/TreeTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/TreeTypeAdaptersTest.java
index dd412ea131..afcc4bccda 100644
--- a/gson/src/test/java/com/google/gson/functional/TreeTypeAdaptersTest.java
+++ b/gson/src/test/java/com/google/gson/functional/TreeTypeAdaptersTest.java
@@ -57,7 +57,7 @@ protected void setUp() {
.registerTypeAdapter(Id.class, new IdTreeTypeAdapter())
.create();
course = new Course(COURSE_ID, 4,
- new Assignment(null, null), createList(STUDENT1, STUDENT2));
+ new Assignment(null, null), Arrays.asList(STUDENT1, STUDENT2));
}
public void testSerializeId() {
@@ -171,9 +171,4 @@ public Assignment(Id> id, T data) {
private static class HistoryCourse {
int numClasses;
}
-
- @SafeVarargs
- private static List createList(T ...items) {
- return Arrays.asList(items);
- }
}
diff --git a/pom.xml b/pom.xml
index 2c6dc9d617..0e888b64f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
UTF-8
- 1.7
+ 7
@@ -68,23 +68,42 @@
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
+
+ ${javaVersion}
+
+ [11,)
+
+
org.apache.maven.plugins
maven-javadoc-plugin
3.3.1
+
+
+ [11,)
+
+
+ all,-missing
+
+ false
+
+ https://docs.oracle.com/en/java/javase/11/docs/api/
+
+
+ false
+
org.apache.maven.plugins
maven-jar-plugin
3.2.0
-
- org.apache.felix
- maven-bundle-plugin
- 5.1.3
- true
-
@@ -110,23 +129,4 @@
-
-
- doclint-java8-disable
-
- [1.8,)
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- -Xdoclint:none
-
-
-
-
-
-
diff --git a/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java
index d588d82404..742916b998 100644
--- a/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java
+++ b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java
@@ -191,7 +191,7 @@ public static Builder newBuilder() {
private static final com.google.protobuf.Descriptors.FieldDescriptor.Type ENUM_TYPE =
com.google.protobuf.Descriptors.FieldDescriptor.Type.ENUM;
- private static final ConcurrentMap, Method>> mapOfMapOfMethods =
+ private static final ConcurrentMap, Method>> mapOfMapOfMethods =
new MapMaker().makeMap();
private final EnumSerialization enumSerialization;
@@ -308,7 +308,7 @@ public Message deserialize(JsonElement json, Type typeOfT,
}
}
}
- return (Message) protoBuilder.build();
+ return protoBuilder.build();
} catch (SecurityException e) {
throw new JsonParseException(e);
} catch (NoSuchMethodException e) {
@@ -396,10 +396,10 @@ private EnumValueDescriptor findValueByNameAndExtension(EnumDescriptor desc,
private static Method getCachedMethod(Class> clazz, String methodName,
Class>... methodParamTypes) throws NoSuchMethodException {
- Map, Method> mapOfMethods = mapOfMapOfMethods.get(methodName);
+ ConcurrentMap, Method> mapOfMethods = mapOfMapOfMethods.get(methodName);
if (mapOfMethods == null) {
mapOfMethods = new MapMaker().makeMap();
- Map, Method> previous =
+ ConcurrentMap, Method> previous =
mapOfMapOfMethods.putIfAbsent(methodName, mapOfMethods);
mapOfMethods = previous == null ? mapOfMethods : previous;
}