Skip to content

Commit

Permalink
8049301: Suspicious use of string identity checks in JComponent.setUI…
Browse files Browse the repository at this point in the history
…Property

Reviewed-by: azvegint
  • Loading branch information
prsadhuk committed Jul 30, 2021
1 parent 89f5c96 commit baf7797
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java.desktop/share/classes/javax/swing/JComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -4191,25 +4191,25 @@ void clientPropertyChanged(Object key, Object oldValue,
* @param value Object containing the property value
*/
void setUIProperty(String propertyName, Object value) {
if (propertyName == "opaque") {
if ("opaque".equals(propertyName)) {
if (!getFlag(OPAQUE_SET)) {
setOpaque(((Boolean)value).booleanValue());
setFlag(OPAQUE_SET, false);
}
} else if (propertyName == "autoscrolls") {
} else if ("autoscrolls".equals(propertyName)) {
if (!getFlag(AUTOSCROLLS_SET)) {
setAutoscrolls(((Boolean)value).booleanValue());
setFlag(AUTOSCROLLS_SET, false);
}
} else if (propertyName == "focusTraversalKeysForward") {
} else if ("focusTraversalKeysForward".equals(propertyName)) {
@SuppressWarnings("unchecked")
Set<AWTKeyStroke> strokeSet = (Set<AWTKeyStroke>) value;
if (!getFlag(FOCUS_TRAVERSAL_KEYS_FORWARD_SET)) {
super.setFocusTraversalKeys(KeyboardFocusManager.
FORWARD_TRAVERSAL_KEYS,
strokeSet);
}
} else if (propertyName == "focusTraversalKeysBackward") {
} else if ("focusTraversalKeysBackward".equals(propertyName)) {
@SuppressWarnings("unchecked")
Set<AWTKeyStroke> strokeSet = (Set<AWTKeyStroke>) value;
if (!getFlag(FOCUS_TRAVERSAL_KEYS_BACKWARD_SET)) {
Expand Down

1 comment on commit baf7797

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.