On Tue, 5 Nov 2024 16:34:47 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   stylistic changes
>
> 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.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1605#discussion_r1829942979

Reply via email to