ICU-22919 Enable CI with JDK 21 and fix the json parsing #3214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the code of the problem is a change in how Java parses strings to
Double
:The results are:
jdk 17 :
1.23456789012345677E18
jdk 21 :
1.2345678901234568E18
The json parser was seeing a number and parsed it to a
Double
.With the change the json parser sees a string and passes that on to our test suite, and the string is parsed / interpreted by our code.
So we just took control from the json parser.
Java supports a
long value = 1234567890123456789L
, there is no rounding, and the result fromMessageFormatter
is"1,234,567,890,123,456,789"
, as one would expect.So the current fix does not need to change any code in
MessageFormatter
.It only bypasses the json parsing of numbers and informs the test code on how to parse the string value.
Before (json parser in control):
value: 1234567890123456789
After (our test suite in control):
value: {"decimal": "1234567890123456789"}
Checklist