On Fri, 30 Jul 2021 20:50:05 GMT, Sergey Bylokhov wrote:
> > I believe it was an optimisation to make comparison as quick as possible.
> > There are many places in Swing where property keys are compared as object
> > identity rather than using `equals`. If this place is changed, probably all
On Fri, 30 Jul 2021 18:26:56 GMT, Alexey Ivanov wrote:
> I believe it was an optimisation to make comparison as quick as possible.
> There are many places in Swing where property keys are compared as object
> identity rather than using `equals`. If this place is changed, probably all
> other
On Fri, 30 Jul 2021 10:38:58 GMT, Prasanta Sadhukhan
wrote:
>> JComponent.setUIProperty method uses string identity check (==) rather than
>> string equality checks (.equals) when comparing against the property name.
>> This is suspicious since string identity and equality and equivalent only
On Fri, 30 Jul 2021 15:17:41 GMT, Alexander Zvegintsev
wrote:
>> I have taken care of NPE..I am not sure of switch which probably might be a
>> hindrance in backporting if needed to earlier release trains.
>> CI is also run..link in JBS.
>
>> I am not sure of switch which probably might be a
On Fri, 30 Jul 2021 10:38:58 GMT, Prasanta Sadhukhan
wrote:
>> JComponent.setUIProperty method uses string identity check (==) rather than
>> string equality checks (.equals) when comparing against the property name.
>> This is suspicious since string identity and equality and equivalent only
On Fri, 30 Jul 2021 10:35:46 GMT, Prasanta Sadhukhan
wrote:
> I am not sure of switch which probably might be a hindrance in backporting if
> needed to earlier release trains.
You still can use the old switch statement with breaks.
-
PR:
On Fri, 30 Jul 2021 09:32:10 GMT, Alexander Zvegintsev
wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Prevent NPE
>
> src/java.desktop/share/classes/javax/swing/JComponent.java line 4194:
>
>> 4192:
> JComponent.setUIProperty method uses string identity check (==) rather than
> string equality checks (.equals) when comparing against the property name.
> This is suspicious since string identity and equality and equivalent only for
> interned strings.
> Rectified to use String.equals()