< prev index next >

src/share/classes/sun/awt/AWTAutoShutdown.java

Print this page
rev 1571 : 8010297: Missing isLoggable() checks in logging code
Summary: Add isLoggable() checks
Reviewed-by: anthony, mchung, serb
Contributed-by: Laurent Bourges <bourges.laurent@gmail.com>

@@ -30,10 +30,11 @@
 import java.security.PrivilegedAction;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
 import java.util.Map;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import sun.misc.ThreadGroupUtils;
 
 /**

@@ -372,16 +373,18 @@
             }
         }
     }
 
     final void dumpPeers(final Logger aLog) {
+        if (aLog.isLoggable(Level.FINE)) {
         synchronized (activationLock) {
             synchronized (mainLock) {
                 aLog.fine("Mapped peers:");
                 for (Object key : peerMap.keySet()) {
                     aLog.fine(key + "->" + peerMap.get(key));
                 }
             }
         }
     }
+    }
 
 } // class AWTAutoShutdown
< prev index next >