-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change target Java version to 7 #2043
Conversation
@@ -1,4 +1,4 @@ | |||
# gson-codegen |
There was a problem hiding this comment.
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).
sourceCompatibility = 1.6 | ||
targetCompatibility = 1.6 | ||
sourceCompatibility = 1.7 | ||
targetCompatibility = 1.7 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
dcd9854
to
1fb719d
Compare
Thanks! Alea jacta est. |
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.shDone, see google/oss-fuzz#7086