RFR: 8313424: JavaFX controls in the title bar [v21]
Andy Goryachev
angorya at openjdk.org
Tue Nov 5 20:17:37 UTC 2024
On Tue, 5 Nov 2024 20:10:36 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/javafx/scene/layout/HeaderBar.java line 118:
>>
>>> 116:
>>> 117: private static final String ALIGNMENT = "headerbar-alignment";
>>> 118: private static final String MARGIN = "headerbar-margin";
>>
>> Q: should these be a String or an Object? String.equals() are more expensive.
>>
>> (I guess we use Strings elsewhere, so probably ok).
>
> String literals are guaranteed to be interned by the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se23/html/jls-3.html#jls-3.10.5), so `equals()` is just a reference comparison.
good point.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1605#discussion_r1829947138
More information about the openjfx-dev
mailing list