On Mon, 29 Jun 2026 18:31:51 GMT, Naoto Sato <[email protected]> wrote:

>> I kept it vague on purpose because I think it is simpler to defer to 
>> `Double.parseDouble` rather than commit to a concrete list which would 
>> mostly rehash the lexical syntax rules defined in `Double.valueOf`. For 
>> example, I would also have to list that hex syntax and floating-point 
>> suffixes are allowed. What do you think?
>
> Defering is fine. Maybe saying "spell out" was too strong, but I would 
> include typical deviations. I think noting 3+ fractions and scientific is 
> useful.
> 
> BTW, the IAE error message differs for eg, "3.0e0" vs "Infinity":
> 
> jshell> Locale.LanguageRange.parse("en;q=3.0e0")
> |  Exception java.lang.IllegalArgumentException: weight=3.0 for language 
> range "en". It must be between 0.0 and 1.0.
> 
> vs.
> 
> jshell> Locale.LanguageRange.parse("en;q=Infinity")
> |  Exception java.lang.IllegalArgumentException: weight="infinity" for 
> language range "en"
> 
> Both are accepted by `Double.parseDouble()`, invalid syntax from RFC point, 
> and out-of-bounds. I would expect a consistency here

Updated the IAE messages to use "inclusive" wording and standardized them on 
the `parse` side. Added those other examples to the `@implNote` wording as well.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31697#discussion_r3494091969

Reply via email to