RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v2]
Michael Strauß
mstrauss at openjdk.org
Fri Feb 13 21:03:07 UTC 2026
On Fri, 13 Feb 2026 19:12:44 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> `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"));
We already test zeros specifically in `preserveNegativeZero()`.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2806062562
More information about the openjfx-dev
mailing list