On Tue, 1 Sep 2026 17:31:38 GMT, Naoto Sato <[email protected]> wrote:

>> This PR implements [JEP 540: Simple JSON API 
>> (Incubator)](https://openjdk.org/jeps/540).
>> 
>> It adds the `jdk.incubator.json` module which provides APIs for reading and 
>> writing JSON documents as specified by [RFC 
>> 8259](https://datatracker.ietf.org/doc/html/rfc8259). This is an incubating 
>> API.
>> 
>> API documentation: 
>> https://cr.openjdk.org/~naoto/json/javadoc/api/jdk.incubator.json/module-summary.html
>> Co-authored-by: Justin Lu 
>> ([@justin-curtis-lu](https://github.com/justin-curtis-lu)), Stuart Marks 
>> ([@stuart-marks](https://github.com/stuart-marks)) 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Naoto Sato has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'jdk-sandbox/json' into 
> JDK-8381976-Implementation-for-Simple-JSON-API
>  - Use SequencedMap type for the member field

src/jdk.incubator.json/share/classes/jdk/incubator/json/impl/JsonNumberImpl.java
 line 125:

> 123:                 // Remove trailing zeros from the significand and 
> compensate in the power.
> 124:                 // We do this to avoid possible overflow when we parse 
> the coefficient as a long.
> 125:                 // E.g. 9223372036854775807.000000 or 
> 922337203685477580700.0e-2

I'm not sure what "coefficient" is in this context. Is it the significand, or 
rather, the significand with trailing zeroes stripped? Also, I think overflow 
cannot be avoided in general, but doing the zero-stripping will reduce the 
possibility of this. Of course there is the possibility that the exponent 
(power) could overflow because of this, but this seems less likely.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3910260589

Reply via email to