Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8274317: Unnecessary reentrant synchronized block in java.awt.Cursor
Reviewed-by: serb, pbansal, prr
  • Loading branch information
turbanoff authored and Pankaj Bansal committed Sep 27, 2021
1 parent 7426fd4 commit 7436a77
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/java.desktop/share/classes/java/awt/Cursor.java
Expand Up @@ -295,10 +295,7 @@ public static Cursor getSystemCustomCursor(final String name)
Cursor cursor = systemCustomCursors.get(name);

if (cursor == null) {
synchronized(systemCustomCursors) {
if (systemCustomCursorProperties == null)
loadSystemCustomCursorProperties();
}
loadSystemCustomCursorProperties();

String prefix = CURSOR_DOT_PREFIX + name;
String key = prefix + DOT_FILE_SUFFIX;
Expand Down Expand Up @@ -433,7 +430,10 @@ public String toString() {
*/
@SuppressWarnings("removal")
private static void loadSystemCustomCursorProperties() throws AWTException {
synchronized(systemCustomCursors) {
synchronized (systemCustomCursors) {
if (systemCustomCursorProperties != null) {
return;
}
systemCustomCursorProperties = new Properties();

try {
Expand Down

1 comment on commit 7436a77

@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.