RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v15]
Andy Goryachev
angorya at openjdk.org
Mon Feb 23 21:27:20 UTC 2026
On Mon, 23 Feb 2026 21:23:55 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 tests
modules/javafx.graphics/src/test/java/test/com/sun/javafx/css/parser/CssNumberParserTest.java line 396:
> 394: double v = value;
> 395: for (int i = 0; i < 3; i++) {
> 396: v = Math.nextUp(v);
My original intent was to add the adjacent value tests to two of your fuzzing tests. The pattern test is a wrong place, I think.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2843159201
More information about the openjfx-dev
mailing list