Unnecessary synchronized on GTKStyle#ICONS_MAP can be removed

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 24
    • Affects Version/s: 21
    • Component/s: client-libs

      static static final Map<String,GTKStockIcon> is modified only in 'static' block. Then 'com.sun.java.swing.plaf.gtk.GTKStyle#get' method read from it withing synchronized (ICONS_MAP) block.
      As this map is read-only and all its content is initialized in clinit we can safely remove 'synchronized' from 'get' call

              GTKStockIcon stockIcon = null;
              synchronized (ICONS_MAP) {
                  stockIcon = ICONS_MAP.get(key);
              }

            Assignee:
            Abhishek Kumar (Inactive)
            Reporter:
            Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: