On Fri, 14 Aug 2026 16:52:57 GMT, Justin Lu <[email protected]> wrote:
>> src/jdk.incubator.json/share/classes/jdk/incubator/json/JsonValue.java line
>> 101:
>>
>>> 99: * {@code long} if its numeric value can be represented
>>> exactly.</li>
>>> 100: * <li>{@code asDouble()} converts a {@code JsonNumber} instance
>>> to a Java
>>> 101: * {@code double} if its numeric value can be represented
>>> accurately.</li>
>>
>> You addressed my previous comment about JsonNumber::asDouble doing the
>> conversion with Double.parseDouble and rounding to the nearest representable
>> double. I'm just wondering now about the class description where it uses
>> "represented accurately" as it seems to conflict.
>
> This particular text is shared from the JEP, so it intentionally does not get
> into too much detail at this point. Would you be okay with "if its numeric
> value can be rounded to a finite Java double"? I think we want to avoid
> relying on `Double.parseDouble` at this point.
>
> Another option if the goal is to keep the same "can be represented ..."
> structure, is replacing accurately with faithfully, although that might be
> vague.
Thanks, this is better. The main thing is that "represented accurately" is
replaced and avoids a conflict in the space.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3789697661