RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v10]
Andy Goryachev
angorya at openjdk.org
Thu Feb 19 17:13:57 UTC 2026
On Thu, 19 Feb 2026 11:04:27 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> Color.web(string, double) parses a color string by creating substrings of the input. These string allocations can be removed.
>>
>> CSS numbers are parsed by `CssNumberParser`, which parses CSS-compliant numbers using Lemire's algorithm.
>>
>> There are no new tests for the `Color` class, since the existing tests already cover all relevant code paths.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>
> add test
modules/javafx.graphics/src/test/java/test/com/sun/javafx/css/parser/CssNumberParserTest.java line 234:
> 232: double expected = Double.parseDouble(number);
> 233: double actual = parseDouble(number);
> 234: assertEquals(Double.doubleToRawLongBits(expected), Double.doubleToRawLongBits(actual));
would it be possible in these fuzzing tests (which are great, by the way!) add a check for a few values adjacent to each point (i.e. +1 ulp, +2 ulp, -1 ulp, -2 ulp)?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2829067996
More information about the openjfx-dev
mailing list