RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v2]

Andy Goryachev angorya at openjdk.org
Fri Feb 13 19:43:08 UTC 2026


On Tue, 10 Feb 2026 20:18:32 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> I don't know.  The new parser parses "-0.0" as -0.0, and while (-0.0 == 0.0), the result of some other operations is different (1/-0.0 = -Infinity).
>> 
>> Does it constitutes a regression risk for applications?
>
> `CssNumberParser` parses "-0" correctly as -0, just like `Double.parseDouble()` currently does. The existing code in `Color` is unchanged.

Since this file is testing the parser and not the CSS handling of negative zeros, I think we should test for the results if parsing "0.0" and "-0.0".

For example:

assertEquals(Double.valueOf(0.0), Double.valueOf(parseDouble("0.0"));
assertEquals(Double.valueOf(-0.0), Double.valueOf(parseDouble("-0.0"));

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2805696464


More information about the openjfx-dev mailing list