-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
GSON failure toJson in JDK21 #1101
Comments
The above is the source code of the toJson method in Gson. I suspect this issue is related to StringBuffer or AbstractStringBuilder. |
@funky-eyes you need to report this to the GSon folks in the first instance. |
FWIW, this sounds like https://bugs.openjdk.org/browse/JDK-8324308 and friends (caused by the CLDR update in 21). |
Yes, I have already reported it to the Gson community at google/gson#2689 . However, I believe this is caused by changes in the JDK, as the same code produces different results when using the same logic with different JDK versions. |
thx. |
@karianna I don't think there is anything for us to do here. The fix needs to be in gson to support JDK 21+. So closing this issue. |
Please provide a brief summary of the bug
Gson version 2.10.1
Using JDK 21 to perform fromJson, the Date type contains hidden characters causing the failure of the toJson operation.
In GitHub issues, it seems that I cannot illustrate it, so I will use images to show
Java / Android version
jdk21
Did you test with the latest update version?
Please provide steps to reproduce where possible
No response
Expected Results
Consistent with jdk17 output
Actual Results
What Java Version are you using?
21.0.2
What is your operating system and platform?
mac os arm64
How did you install Java?
tar.gz
Did it work before?
No response
Did you test with other Java versions?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: