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

Andy Goryachev angorya at openjdk.org
Wed Feb 11 09:57:23 UTC 2026


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

>> modules/javafx.graphics/src/test/java/test/com/sun/javafx/css/parser/CssNumberParserTest.java line 40:
>> 
>>> 38:     @Test
>>> 39:     public void parseIntegerAndSignedInteger() {
>>> 40:         assertEquals(0.0, parseDouble("0"), 0.0);
>> 
>> The JavaFX CSS spec also states
>> 
>> 
>> -0 is equivalent to 0 and is not a negative number.
>> 
>> 
>> How should we test this?
>
> On the JVM, `-0 == 0`. It seems to me that this sentence just spells it out, doesn't it?

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?

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

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


More information about the openjfx-dev mailing list