-
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
JDK 15: Illegal reflective access to java.time classes #1807
Comments
Same as #1059. Gson currently has no built-in support for classes added in Java 7+. It therefore falls back to the reflection based approach for serializing these classes, which is likely not what you want and also makes your code dependent on the implementation details of the JDK (which is why you are seeing these warnings). So you would have to write your own |
Yes, as a workaround, I wrote my own adapters like below:
|
Note that it is recommended to prefer |
I will look at it. Thank you! |
Can probably be closed as duplicate of #1059. |
JDK 15 produces many Illegal reflective access warnings like following on serializing LocalTime, LocalDateTime, YearMonth, MonthYear and so on:
Code example
The text was updated successfully, but these errors were encountered: