8274317: Unnecessary reentrant synchronized block in java.awt.Cursor

Reviewed-by: serb, pbansal, prr
This commit is contained in:
Andrey Turbanov 2021-09-27 12:07:29 +00:00 committed by Pankaj Bansal
parent 7426fd4c9c
commit 7436a77e3d

View File

@ -295,10 +295,7 @@ public class Cursor implements java.io.Serializable {
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;
@ -433,7 +430,10 @@ public class Cursor implements java.io.Serializable {
*/
@SuppressWarnings("removal")
private static void loadSystemCustomCursorProperties() throws AWTException {
synchronized(systemCustomCursors) {
synchronized (systemCustomCursors) {
if (systemCustomCursorProperties != null) {
return;
}
systemCustomCursorProperties = new Properties();
try {