Skip to content

Conversation

Marcono1234
Copy link
Contributor

@Marcono1234 Marcono1234 commented Dec 30, 2021

Resolves #2018

Also tries to add some documentation to the README regarding Java version and JPMS module requirements. I am not sure if the formatting and wording is ideal; feedback is appreciated.

Follow-up task:
Remove the Java version overwrite (and comment) in https://github.com/google/oss-fuzz/blob/master/projects/gson/build.sh
Done, see google/oss-fuzz#7086

@@ -1,4 +1,4 @@
# gson-codegen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was an oversight by me; all other modules are using the folder name (instead of the artifact ID).

Comment on lines -7 to +8
sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.7
targetCompatibility = 1.7
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably does not matter because the Gradle build is outdated anyway, see #1896.

@@ -161,7 +161,7 @@ public void testJavaSerialization() throws IOException, ClassNotFoundException {
}

@SafeVarargs
private <T> void assertIterationOrder(Iterable<T> actual, T... expected) {
private final <T> void assertIterationOrder(Iterable<T> actual, T... expected) {
Copy link
Contributor Author

@Marcono1234 Marcono1234 Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly when changing the version to Java 7 this caused a build failure (due to private methods not supporting @SafeVarargs in Java 7), but when the version was Java 6 this compiled fine. Most likely because @SafeVarargs was added in Java 7, but (unlike --release) the -source and -target compiler flags do not prevent using newer API.

@eamonnmcmanus eamonnmcmanus merged commit dc28951 into google:master Dec 31, 2021
@eamonnmcmanus
Copy link
Member

Thanks! Alea jacta est.

@Marcono1234 Marcono1234 deleted the marcono1234/java-7 branch January 1, 2022 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop support for Java 6
2 participants