<Swing Dev> RFR: 8049301: Suspicious use of string identity checks in JComponent.setUIProperty [v2]
Sergey Bylokhov
serb at openjdk.java.net
Fri Jul 30 20:53:34 UTC 2021
On Fri, 30 Jul 2021 18:26:56 GMT, Alexey Ivanov <aivanov at openjdk.org> 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 such places need updating if they haven't been updated to `equals` yet.
Probably it will be better to roll back this one, and carefully check the usage of "==" for possible replacement by the "equal". That possibility should be proved by some test cases.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4943
More information about the swing-dev
mailing list