Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274317

Unnecessary reentrant synchronized block in java.awt.Cursor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 18
    • 16, 17
    • client-libs
    • None
    • b17

    Description

      There is lock on a field java.awt.Cursor.systemCustomCursors which is taken twice:
      1. In a method java.awt.Cursor#getSystemCustomCursor:
      ```
                  synchronized(systemCustomCursors) {
                      if (systemCustomCursorProperties == null)
                          loadSystemCustomCursorProperties();
                  }
      ```
      2. And then again in method 'loadSystemCustomCursorProperties' itself
      ```
      private static void loadSystemCustomCursorProperties() throws AWTException {
              synchronized(systemCustomCursors) {
                  systemCustomCursorProperties = new Properties();
      ```

      Such reentrancy is redundant and confusing.

      Attachments

        Issue Links

          Activity

            People

              aturbanov Andrey Turbanov
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: