-
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
fix Java9 DateFormat changes #1211
Conversation
/** | ||
* @return {@code true} if the application is running on Java 9 or later; and {@code false} otherwise. | ||
*/ | ||
public static boolean isJava9OrLater() { |
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.
Does this logic work on Android?
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.
Good question! For Android, "java.version" is "0", so the method getMajorJavaVersion() returns "0", and isJava9OrLater() returns "false". Guess it is fine until Android is actually moved to Java 9 (if it will ever happen).
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.
https://developer.android.com/about/versions/13/features#core-libraries
Android 13 starts the work of refreshing Android's core libraries to align with the OpenJDK 11 LTS release with both library updates and Java 11 language support for application and platform developers. The core library changes introduced in Android 13 will also be available to Android 12 devices through a Google Play system update to the ART Mainline Module.
Android is moving to newer Java implementations
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.
@seventhmoon, thanks for pointing that out. Would you mind creating a separate issue so that we can investigate there if / which effect this will have on Gson and its VersionUtils.isJava9OrLater()
method?
Edit: Follow-up issue #2365
When do you plan to release a new version which includes this fix? |
* fix Java9 DateFormat changes * fix Codacy warnings
* fix Java9 DateFormat changes * fix Codacy warnings
Vh |
Adopts Gson for Java9 DateFormat changes, as described in issue #1210