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

Unnecessary synchronized on GTKStyle#ICONS_MAP can be removed

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 21
    • 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);
              }

            abhiscxk Abhishek Kumar
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: