8010297: Missing isLoggable() checks in logging code
authoranthony
Fri, 12 Apr 2013 14:33:38 +0400
changeset 16839 d0f2e97b7359
parent 16838 ea714f11d40d
child 16840 64446d4710c4
8010297: Missing isLoggable() checks in logging code Summary: Add isLoggable() checks Reviewed-by: anthony, mchung, serb Contributed-by: Laurent Bourges <bourges.laurent@gmail.com>
jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java
jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java
jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
jdk/src/share/classes/java/awt/EventDispatchThread.java
jdk/src/share/classes/java/awt/KeyboardFocusManager.java
jdk/src/share/classes/java/awt/WaitDispatchSupport.java
jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java
jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java
jdk/src/share/classes/sun/awt/AWTAutoShutdown.java
jdk/src/share/classes/sun/awt/DebugSettings.java
jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java
jdk/src/share/classes/sun/awt/SunToolkit.java
jdk/src/share/classes/sun/awt/im/InputContext.java
jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java
jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java
jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java
jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java
jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java
jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java
jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java
jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java
jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java
jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java
jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java
jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java
jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java
jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java
jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java
jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java
jdk/src/solaris/classes/sun/awt/X11/XListPeer.java
jdk/src/solaris/classes/sun/awt/X11/XMSelection.java
jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java
jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java
jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java
jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java
jdk/src/solaris/classes/sun/awt/X11/XProtocol.java
jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java
jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java
jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java
jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java
jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java
jdk/src/solaris/classes/sun/awt/X11/XWM.java
jdk/src/solaris/classes/sun/awt/X11/XWindow.java
jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java
jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java
jdk/src/solaris/classes/sun/awt/X11InputMethod.java
jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java
--- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -1152,7 +1152,9 @@
         if (!becomesFocused &&
             (isGrabbing() || getOwnerFrameDialog(grabbingWindow) == this))
         {
-            focusLog.fine("ungrabbing on " + grabbingWindow);
+            if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                focusLog.fine("ungrabbing on " + grabbingWindow);
+            }
             // ungrab a simple window if its owner looses activation.
             grabbingWindow.ungrab();
         }
--- a/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java	Fri Apr 12 14:33:38 2013 +0400
@@ -208,7 +208,9 @@
      *         aComponent is null
      */
     public Component getComponentAfter(Container aContainer, Component aComponent) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Searching in " + aContainer + " for component after " + aComponent);
+        }
 
         if (aContainer == null || aComponent == null) {
             throw new IllegalArgumentException("aContainer and aComponent cannot be null");
@@ -247,7 +249,9 @@
                 // Null result means that we overstepped the limit of the FTP's cycle.
                 // In that case we must quit the cycle, otherwise return the component found.
                 if (afterComp != null) {
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("### FTP returned " + afterComp);
+                    }
                     return afterComp;
                 }
                 aComponent = provider;
@@ -255,7 +259,9 @@
 
             List<Component> cycle = getFocusTraversalCycle(aContainer);
 
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+            }
 
             int index = getComponentIndex(cycle, aComponent);
 
@@ -336,7 +342,9 @@
                 // Null result means that we overstepped the limit of the FTP's cycle.
                 // In that case we must quit the cycle, otherwise return the component found.
                 if (beforeComp != null) {
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("### FTP returned " + beforeComp);
+                    }
                     return beforeComp;
                 }
                 aComponent = provider;
@@ -349,7 +357,9 @@
 
             List<Component> cycle = getFocusTraversalCycle(aContainer);
 
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+            }
 
             int index = getComponentIndex(cycle, aComponent);
 
@@ -401,7 +411,9 @@
     public Component getFirstComponent(Container aContainer) {
         List<Component> cycle;
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Getting first component in " + aContainer);
+        }
         if (aContainer == null) {
             throw new IllegalArgumentException("aContainer cannot be null");
 
@@ -420,10 +432,14 @@
             }
 
             if (cycle.size() == 0) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("### Cycle is empty");
+                }
                 return null;
             }
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("### Cycle is " + cycle);
+            }
 
             for (Component comp : cycle) {
                 if (accept(comp)) {
@@ -451,7 +467,9 @@
      */
     public Component getLastComponent(Container aContainer) {
         List<Component> cycle;
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Getting last component in " + aContainer);
+        }
 
         if (aContainer == null) {
             throw new IllegalArgumentException("aContainer cannot be null");
@@ -470,10 +488,14 @@
             }
 
             if (cycle.size() == 0) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("### Cycle is empty");
+                }
                 return null;
             }
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("### Cycle is " + cycle);
+            }
 
             for (int i= cycle.size() - 1; i >= 0; i--) {
                 Component comp = cycle.get(i);
--- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Fri Apr 12 14:33:38 2013 +0400
@@ -310,7 +310,9 @@
      *         <code>false</code> otherwise
      */
     public boolean dispatchEvent(AWTEvent e) {
-        if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) focusLog.fine("" + e);
+        if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) {
+            focusLog.fine("" + e);
+        }
         switch (e.getID()) {
             case WindowEvent.WINDOW_GAINED_FOCUS: {
                 if (repostIfFollowsKeyEvents((WindowEvent)e)) {
@@ -871,7 +873,9 @@
                         }
                     }
                     if (ke != null) {
-                        focusLog.finer("Pumping approved event {0}", ke);
+                        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                            focusLog.finer("Pumping approved event {0}", ke);
+                        }
                         enqueuedKeyEvents.removeFirst();
                     }
                 }
@@ -920,7 +924,9 @@
                         // The fix is rolled out.
 
                         if (ke.getWhen() > marker.after) {
-                            focusLog.finer("Storing event {0} because of marker {1}", ke, marker);
+                            if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                                focusLog.finer("Storing event {0} because of marker {1}", ke, marker);
+                            }
                             enqueuedKeyEvents.addLast(ke);
                             return true;
                         }
@@ -932,7 +938,9 @@
             }
 
             case FocusEvent.FOCUS_GAINED:
-                focusLog.finest("Markers before FOCUS_GAINED on {0}", target);
+                if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+                    focusLog.finest("Markers before FOCUS_GAINED on {0}", target);
+                }
                 dumpMarkers();
                 // Search the marker list for the first marker tied to
                 // the Component which just gained focus. Then remove
@@ -959,7 +967,9 @@
                         }
                     } else {
                         // Exception condition - event without marker
-                        focusLog.finer("Event without marker {0}", e);
+                        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                            focusLog.finer("Event without marker {0}", e);
+                        }
                     }
                 }
                 focusLog.finest("Markers after FOCUS_GAINED");
@@ -1198,8 +1208,10 @@
             return;
         }
 
-        focusLog.finer("Enqueue at {0} for {1}",
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer("Enqueue at {0} for {1}",
                        after, untilFocused);
+        }
 
         int insertionIndex = 0,
             i = typeAheadMarkers.size();
@@ -1238,8 +1250,10 @@
             return;
         }
 
-        focusLog.finer("Dequeue at {0} for {1}",
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer("Dequeue at {0} for {1}",
                        after, untilFocused);
+        }
 
         TypeAheadMarker marker;
         ListIterator<TypeAheadMarker> iter = typeAheadMarkers.listIterator
--- a/jdk/src/share/classes/java/awt/EventDispatchThread.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java	Fri Apr 12 14:33:38 2013 +0400
@@ -138,7 +138,9 @@
     }
 
     void addEventFilter(EventFilter filter) {
-        eventLog.finest("adding the event filter: " + filter);
+        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
+            eventLog.finest("adding the event filter: " + filter);
+        }
         synchronized (eventFilters) {
             if (!eventFilters.contains(filter)) {
                 if (filter instanceof ModalEventFilter) {
@@ -162,7 +164,9 @@
     }
 
     void removeEventFilter(EventFilter filter) {
-        eventLog.finest("removing the event filter: " + filter);
+        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
+            eventLog.finest("removing the event filter: " + filter);
+        }
         synchronized (eventFilters) {
             eventFilters.remove(filter);
         }
--- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Fri Apr 12 14:33:38 2013 +0400
@@ -2410,7 +2410,7 @@
         Window nativeFocusedWindow = thisManager.getNativeFocusedWindow();
         if (focusLog.isLoggable(PlatformLogger.FINER)) {
             focusLog.finer("SNFH for {0} in {1}",
-                           String.valueOf(descendant), String.valueOf(heavyweight));
+                       String.valueOf(descendant), String.valueOf(heavyweight));
         }
         if (focusLog.isLoggable(PlatformLogger.FINEST)) {
             focusLog.finest("0. Current focus owner {0}",
@@ -2478,9 +2478,10 @@
                     manager.enqueueKeyEvents(time, descendant);
                 }
 
-                if (focusLog.isLoggable(PlatformLogger.FINEST))
+                if (focusLog.isLoggable(PlatformLogger.FINEST)) {
                     focusLog.finest("3. SNFH_HANDLED for lightweight" +
                                     descendant + " in " + heavyweight);
+                }
                 return SNFH_SUCCESS_HANDLED;
             } else {
                 if (!focusedWindowChangeAllowed) {
@@ -2501,8 +2502,9 @@
                                              (hwFocusRequest != null)
                                              ? hwFocusRequest.heavyweight
                                              : nativeFocusedWindow)) {
-                        if (focusLog.isLoggable(PlatformLogger.FINEST))
+                        if (focusLog.isLoggable(PlatformLogger.FINEST)) {
                             focusLog.finest("4. SNFH_FAILURE for " + descendant);
+                        }
                         return SNFH_FAILURE;
                     }
                 }
@@ -2511,8 +2513,9 @@
                 heavyweightRequests.add
                     (new HeavyweightFocusRequest(heavyweight, descendant,
                                                  temporary, cause));
-                if (focusLog.isLoggable(PlatformLogger.FINEST))
+                if (focusLog.isLoggable(PlatformLogger.FINEST)) {
                     focusLog.finest("5. SNFH_PROCEED for " + descendant);
+                }
                 return SNFH_SUCCESS_PROCEED;
             }
         }
--- a/jdk/src/share/classes/java/awt/WaitDispatchSupport.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/java/awt/WaitDispatchSupport.java	Fri Apr 12 14:33:38 2013 +0400
@@ -165,8 +165,10 @@
      */
     @Override
     public boolean enter() {
-        log.fine("enter(): blockingEDT=" + keepBlockingEDT.get() +
-                 ", blockingCT=" + keepBlockingCT.get());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("enter(): blockingEDT=" + keepBlockingEDT.get() +
+                     ", blockingCT=" + keepBlockingCT.get());
+        }
 
         if (!keepBlockingEDT.compareAndSet(false, true)) {
             log.fine("The secondary loop is already running, aborting");
@@ -190,9 +192,13 @@
 
         Thread currentThread = Thread.currentThread();
         if (currentThread == dispatchThread) {
-            log.finest("On dispatch thread: " + dispatchThread);
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest("On dispatch thread: " + dispatchThread);
+            }
             if (interval != 0) {
-                log.finest("scheduling the timer for " + interval + " ms");
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("scheduling the timer for " + interval + " ms");
+                }
                 timer.schedule(timerTask = new TimerTask() {
                     @Override
                     public void run() {
@@ -207,7 +213,9 @@
             SequencedEvent currentSE = KeyboardFocusManager.
                 getCurrentKeyboardFocusManager().getCurrentSequencedEvent();
             if (currentSE != null) {
-                log.fine("Dispose current SequencedEvent: " + currentSE);
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Dispose current SequencedEvent: " + currentSE);
+                }
                 currentSE.dispose();
             }
             // In case the exit() method is called before starting
@@ -223,7 +231,9 @@
                 }
             });
         } else {
-            log.finest("On non-dispatch thread: " + currentThread);
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest("On non-dispatch thread: " + currentThread);
+            }
             synchronized (getTreeLock()) {
                 if (filter != null) {
                     dispatchThread.addEventFilter(filter);
@@ -247,9 +257,13 @@
                             getTreeLock().wait();
                         }
                     }
-                    log.fine("waitDone " + keepBlockingEDT.get() + " " + keepBlockingCT.get());
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("waitDone " + keepBlockingEDT.get() + " " + keepBlockingCT.get());
+                    }
                 } catch (InterruptedException e) {
-                    log.fine("Exception caught while waiting: " + e);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("Exception caught while waiting: " + e);
+                    }
                 } finally {
                     if (filter != null) {
                         dispatchThread.removeEventFilter(filter);
@@ -270,8 +284,10 @@
      * @inheritDoc
      */
     public boolean exit() {
-        log.fine("exit(): blockingEDT=" + keepBlockingEDT.get() +
-                 ", blockingCT=" + keepBlockingCT.get());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("exit(): blockingEDT=" + keepBlockingEDT.get() +
+                     ", blockingCT=" + keepBlockingCT.get());
+        }
         if (keepBlockingEDT.compareAndSet(true, false)) {
             wakeupEDT();
             return true;
@@ -295,7 +311,9 @@
     };
 
     private void wakeupEDT() {
-        log.finest("wakeupEDT(): EDT == " + dispatchThread);
+        if (log.isLoggable(PlatformLogger.FINEST)) {
+            log.finest("wakeupEDT(): EDT == " + dispatchThread);
+        }
         EventQueue eq = dispatchThread.getEventQueue();
         eq.postEvent(new PeerEvent(this, wakingRunnable, PeerEvent.PRIORITY_EVENT));
     }
--- a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java	Fri Apr 12 14:33:38 2013 +0400
@@ -523,8 +523,7 @@
                     if (bufferStrategy.contentsRestored()) {
                         contentsLost = true;
                         if (LOGGER.isLoggable(PlatformLogger.FINER)) {
-                            LOGGER.finer(
-                                "prepare: contents restored in prepare");
+                            LOGGER.finer("prepare: contents restored in prepare");
                         }
                     }
                 }
--- a/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java	Fri Apr 12 14:33:38 2013 +0400
@@ -271,7 +271,9 @@
             // Null result means that we overstepped the limit of the FTP's cycle.
             // In that case we must quit the cycle, otherwise return the component found.
             if (afterComp != null) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("### FTP returned " + afterComp);
+                }
                 return afterComp;
             }
             aComponent = provider;
@@ -279,7 +281,9 @@
 
         List<Component> cycle = getFocusTraversalCycle(aContainer);
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+        }
 
         int index = getComponentIndex(cycle, aComponent);
 
@@ -360,7 +364,9 @@
             // Null result means that we overstepped the limit of the FTP's cycle.
             // In that case we must quit the cycle, otherwise return the component found.
             if (beforeComp != null) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("### FTP returned " + beforeComp);
+                }
                 return beforeComp;
             }
             aComponent = provider;
@@ -373,7 +379,9 @@
 
         List<Component> cycle = getFocusTraversalCycle(aContainer);
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+        }
 
         int index = getComponentIndex(cycle, aComponent);
 
@@ -424,7 +432,9 @@
     public Component getFirstComponent(Container aContainer) {
         List<Component> cycle;
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Getting first component in " + aContainer);
+        }
         if (aContainer == null) {
             throw new IllegalArgumentException("aContainer cannot be null");
         }
@@ -436,10 +446,14 @@
         }
 
         if (cycle.size() == 0) {
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("### Cycle is empty");
+            }
             return null;
         }
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Cycle is " + cycle);
+        }
 
         for (Component comp : cycle) {
             if (accept(comp)) {
@@ -466,7 +480,9 @@
      */
     public Component getLastComponent(Container aContainer) {
         List<Component> cycle;
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Getting last component in " + aContainer);
+        }
 
         if (aContainer == null) {
             throw new IllegalArgumentException("aContainer cannot be null");
@@ -479,10 +495,14 @@
         }
 
         if (cycle.size() == 0) {
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("### Cycle is empty");
+            }
             return null;
         }
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### Cycle is " + cycle);
+        }
 
         for (int i= cycle.size() - 1; i >= 0; i--) {
             Component comp = cycle.get(i);
--- a/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/awt/AWTAutoShutdown.java	Fri Apr 12 14:33:38 2013 +0400
@@ -375,11 +375,13 @@
     }
 
     final void dumpPeers(final PlatformLogger aLog) {
-        synchronized (activationLock) {
-            synchronized (mainLock) {
-                aLog.fine("Mapped peers:");
-                for (Object key : peerMap.keySet()) {
-                    aLog.fine(key + "->" + peerMap.get(key));
+        if (aLog.isLoggable(PlatformLogger.FINE)) {
+            synchronized (activationLock) {
+                synchronized (mainLock) {
+                    aLog.fine("Mapped peers:");
+                    for (Object key : peerMap.keySet()) {
+                        aLog.fine(key + "->" + peerMap.get(key));
+                    }
                 }
             }
         }
--- a/jdk/src/share/classes/sun/awt/DebugSettings.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/awt/DebugSettings.java	Fri Apr 12 14:33:38 2013 +0400
@@ -129,7 +129,7 @@
 
         // echo the initial property settings to stdout
         if (log.isLoggable(PlatformLogger.FINE)) {
-            log.fine("DebugSettings:\n{0}" + this);
+            log.fine("DebugSettings:\n{0}", this);
         }
     }
 
--- a/jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java	Fri Apr 12 14:33:38 2013 +0400
@@ -57,8 +57,9 @@
     public void clearGlobalFocusOwner(Window activeWindow) {
         if (activeWindow != null) {
             Component focusOwner = activeWindow.getFocusOwner();
-            if (focusLog.isLoggable(PlatformLogger.FINE))
+            if (focusLog.isLoggable(PlatformLogger.FINE)) {
                 focusLog.fine("Clearing global focus owner " + focusOwner);
+            }
             if (focusOwner != null) {
                 FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
                                                      CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
@@ -126,16 +127,18 @@
             FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST,
                                                  false, lightweightChild, cause);
 
-            if (focusLog.isLoggable(PlatformLogger.FINER))
+            if (focusLog.isLoggable(PlatformLogger.FINER)) {
                 focusLog.finer("Posting focus event: " + fl);
+            }
             SunToolkit.postEvent(SunToolkit.targetToAppContext(currentOwner), fl);
         }
 
         FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED,
                                              false, currentOwner, cause);
 
-        if (focusLog.isLoggable(PlatformLogger.FINER))
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
             focusLog.finer("Posting focus event: " + fg);
+        }
         SunToolkit.postEvent(SunToolkit.targetToAppContext(lightweightChild), fg);
         return true;
     }
--- a/jdk/src/share/classes/sun/awt/SunToolkit.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java	Fri Apr 12 14:33:38 2013 +0400
@@ -487,7 +487,9 @@
         setSystemGenerated(event);
         AppContext eventContext = targetToAppContext(event.getSource());
         if (eventContext != null && !eventContext.equals(appContext)) {
-            log.fine("Event posted on wrong app context : " + event);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Event posted on wrong app context : " + event);
+            }
         }
         PostEventQueue postEventQueue =
             (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
--- a/jdk/src/share/classes/sun/awt/im/InputContext.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/awt/im/InputContext.java	Fri Apr 12 14:33:38 2013 +0400
@@ -387,7 +387,9 @@
             }
             previousInputMethod = null;
 
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("Current client component " + currentClientComponent);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Current client component " + currentClientComponent);
+            }
             if (inputMethod instanceof InputMethodAdapter) {
                 ((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
             }
@@ -884,14 +886,16 @@
     }
 
     private void logCreationFailed(Throwable throwable) {
-        String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
-                                                     "Could not create {0}. Reason: {1}");
-        Object[] args =
-            {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
-             throwable.getLocalizedMessage()};
-        MessageFormat mf = new MessageFormat(errorTextFormat);
         PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
-        logger.config(mf.format(args));
+        if (logger.isLoggable(PlatformLogger.CONFIG)) {
+            String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed",
+                                                         "Could not create {0}. Reason: {1}");
+            Object[] args =
+                {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
+                 throwable.getLocalizedMessage()};
+            MessageFormat mf = new MessageFormat(errorTextFormat);
+            logger.config(mf.format(args));
+        }
     }
 
     InputMethodLocator getInputMethodLocator() {
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Apr 12 14:33:38 2013 +0400
@@ -2065,7 +2065,9 @@
                     ret = new NegotiateAuthentication(new HttpCallerInfo(authhdr.getHttpCallerInfo(), "Kerberos"));
                     break;
                 case UNKNOWN:
-                    logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
+                    if (logger.isLoggable(PlatformLogger.FINEST)) {
+                        logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
+                    }
                 /*fall through*/
                 default:
                     throw new AssertionError("should not reach here");
@@ -2222,7 +2224,9 @@
                     }
                     break;
                 case UNKNOWN:
-                    logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
+                    if (logger.isLoggable(PlatformLogger.FINEST)) {
+                        logger.finest("Unknown/Unsupported authentication scheme: " + scheme);
+                    }
                 /*fall through*/
                 default:
                     throw new AssertionError("should not reach here");
--- a/jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java	Fri Apr 12 14:33:38 2013 +0400
@@ -142,6 +142,8 @@
 
     static void finest(Exception e) {
         PlatformLogger logger = HttpURLConnection.getHttpLogger();
-        logger.finest("NTLMAuthenticationProxy: " + e);
+        if (logger.isLoggable(PlatformLogger.FINEST)) {
+            logger.finest("NTLMAuthenticationProxy: " + e);
+        }
     }
 }
--- a/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/Negotiator.java	Fri Apr 12 14:33:38 2013 +0400
@@ -76,7 +76,9 @@
 
     private static void finest(Exception e) {
         PlatformLogger logger = HttpURLConnection.getHttpLogger();
-        logger.finest("NegotiateAuthentication: " + e);
+        if (logger.isLoggable(PlatformLogger.FINEST)) {
+            logger.finest("NegotiateAuthentication: " + e);
+        }
     }
 }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java	Fri Apr 12 14:33:38 2013 +0400
@@ -55,7 +55,9 @@
     }
 
     void initXSettings() {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Initializing XAWT XSettings");
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Initializing XAWT XSettings");
+        }
         settings = new XMSelection("_XSETTINGS");
         settings.addSelectionListener(this);
         initPerScreenXSettings();
@@ -66,21 +68,29 @@
     }
 
     public void ownerDeath(int screen, XMSelection sel, long deadOwner) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner " + deadOwner + " died for selection " + sel + " screen "+ screen);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Owner " + deadOwner + " died for selection " + sel + " screen "+ screen);
+        }
     }
 
 
     public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Owner "+ newOwner + " for selection = " + sel + " screen " +screen );
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("New Owner "+ newOwner + " for selection = " + sel + " screen " +screen );
+        }
     }
 
     public void selectionChanged(int screen, XMSelection sel, long owner , XPropertyEvent event) {
-        log.fine("Selection changed on sel " + sel + " screen = " + screen + " owner = " + owner + " event = " + event);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Selection changed on sel " + sel + " screen = " + screen + " owner = " + owner + " event = " + event);
+        }
         updateXSettings(screen,owner);
     }
 
     void initPerScreenXSettings() {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Updating Per XSettings changes");
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Updating Per XSettings changes");
+        }
 
         /*
          * As toolkit cannot yet cope with per-screen desktop properties,
@@ -114,7 +124,9 @@
     }
 
     private Map getUpdatedSettings(final long owner) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("owner =" + owner);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("owner =" + owner);
+        }
         if (0 == owner) {
             return null;
         }
@@ -128,13 +140,17 @@
                 int status = getter.execute(XErrorHandler.IgnoreBadWindowHandler.getInstance());
 
                 if (status != XConstants.Success || getter.getData() == 0) {
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("OH OH : getter failed  status = " + status );
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("OH OH : getter failed  status = " + status );
+                    }
                     settings = null;
                 }
 
                 long ptr = getter.getData();
 
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("noItems = " + getter.getNumberOfItems());
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("noItems = " + getter.getNumberOfItems());
+                }
                 byte array[] = Native.toBytes(ptr,getter.getNumberOfItems());
                 if (array != null) {
                     settings = update(array);
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Fri Apr 12 14:33:38 2013 +0400
@@ -426,7 +426,7 @@
         try {
             synchronized(getMenuTreeLock()) {
                 if (showingSubmenu != submenuToShow) {
-                    if (log.isLoggable(PlatformLogger.FINER)) {
+                    if (log.isLoggable(PlatformLogger.FINEST)) {
                         log.finest("Changing showing submenu");
                     }
                     if (showingSubmenu != null) {
@@ -1122,7 +1122,9 @@
      * that grabs input focus
      */
     void doHandleJavaKeyEvent(KeyEvent event) {
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer(event.toString());
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer(event.toString());
+        }
         if (event.getID() != KeyEvent.KEY_PRESSED) {
             return;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java	Fri Apr 12 14:33:38 2013 +0400
@@ -160,7 +160,9 @@
      * with class-specific values and perform post-initialization actions.
      */
     void postInit(XCreateWindowParams params) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("WM name is " + getWMName());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("WM name is " + getWMName());
+        }
         updateWMName();
 
         // Set WM_CLIENT_LEADER property
@@ -480,7 +482,9 @@
     }
 
     public void setSizeHints(long flags, int x, int y, int width, int height) {
-        if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(flags));
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(flags));
+        }
         XToolkit.awtLock();
         try {
             XSizeHints hints = getHints();
@@ -541,8 +545,10 @@
             flags |= XUtilConstants.PWinGravity;
             hints.set_flags(flags);
             hints.set_win_gravity((int)XConstants.NorthWestGravity);
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
-                                                             ", values " + hints);
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
+                             ", values " + hints);
+            }
             XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
         } finally {
             XToolkit.awtUnlock();
@@ -593,7 +599,9 @@
     public void xRequestFocus(long time) {
         XToolkit.awtLock();
         try {
-            if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()) + " with time " + time);
+            if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()) + " with time " + time);
+            }
             XlibWrapper.XSetInputFocus2(XToolkit.getDisplay(), getWindow(), time);
         } finally {
             XToolkit.awtUnlock();
@@ -602,7 +610,9 @@
     public void xRequestFocus() {
         XToolkit.awtLock();
         try {
-            if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()));
+            if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                focusLog.finer("XSetInputFocus on " + Long.toHexString(getWindow()));
+            }
              XlibWrapper.XSetInputFocus(XToolkit.getDisplay(), getWindow());
         } finally {
             XToolkit.awtUnlock();
@@ -619,7 +629,9 @@
     }
 
     public void xSetVisible(boolean visible) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting visible on " + this + " to " + visible);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Setting visible on " + this + " to " + visible);
+        }
         XToolkit.awtLock();
         try {
             this.visible = visible;
@@ -704,7 +716,9 @@
             insLog.warning("Attempt to resize uncreated window");
             throw new IllegalStateException("Attempt to resize uncreated window");
         }
-        insLog.fine("Setting bounds on " + this + " to (" + x + ", " + y + "), " + width + "x" + height);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting bounds on " + this + " to (" + x + ", " + y + "), " + width + "x" + height);
+        }
         width = Math.max(MIN_SIZE, width);
         height = Math.max(MIN_SIZE, height);
         XToolkit.awtLock();
@@ -820,7 +834,9 @@
      * The active grab overrides activated automatic grab.
      */
     public boolean grabInput() {
-        grabLog.fine("Grab input on {0}", this);
+        if (grabLog.isLoggable(PlatformLogger.FINE)) {
+            grabLog.fine("Grab input on {0}", this);
+        }
 
         XToolkit.awtLock();
         try {
@@ -883,7 +899,9 @@
         XToolkit.awtLock();
         try {
             XBaseWindow grabWindow = XAwtState.getGrabWindow();
-            grabLog.fine("UnGrab input on {0}", grabWindow);
+            if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                grabLog.fine("UnGrab input on {0}", grabWindow);
+            }
             if (grabWindow != null) {
                 grabWindow.ungrabInputImpl();
                 if (!XToolkit.getSunAwtDisableGrab()) {
@@ -1021,7 +1039,9 @@
     }
     public void handleConfigureNotifyEvent(XEvent xev) {
         XConfigureEvent xe = xev.get_xconfigure();
-        insLog.finer("Configure, {0}", xe);
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Configure, {0}", xe);
+        }
         x = xe.get_x();
         y = xe.get_y();
         width = xe.get_width();
@@ -1072,7 +1092,9 @@
     }
 
     public void dispatchEvent(XEvent xev) {
-        if (eventLog.isLoggable(PlatformLogger.FINEST)) eventLog.finest(xev.toString());
+        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
+            eventLog.finest(xev.toString());
+        }
         int type = xev.get_type();
 
         if (isDisposed()) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -217,7 +217,9 @@
      * Called when component receives focus
      */
     public void focusGained(FocusEvent e) {
-        focusLog.fine("{0}", e);
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+            focusLog.fine("{0}", e);
+        }
         bHasFocus = true;
     }
 
@@ -225,7 +227,9 @@
      * Called when component loses focus
      */
     public void focusLost(FocusEvent e) {
-        focusLog.fine("{0}", e);
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+            focusLog.fine("{0}", e);
+        }
         bHasFocus = false;
     }
 
@@ -297,8 +301,10 @@
           case XKeyboardFocusManagerPeer.SNFH_SUCCESS_PROCEED:
               // Currently we just generate focus events like we deal with lightweight instead of calling
               // XSetInputFocus on native window
-              if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Proceeding with request to " +
-                  lightweightChild + " in " + target);
+              if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                  focusLog.finer("Proceeding with request to " +
+                                 lightweightChild + " in " + target);
+              }
               /**
                * The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
                * checks that native window is focused while appropriate WINDOW_GAINED_FOCUS has not yet
@@ -322,7 +328,9 @@
                */
               boolean res = wpeer.requestWindowFocus(null);
 
-              if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Requested window focus: " + res);
+              if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                  focusLog.finer("Requested window focus: " + res);
+              }
               // If parent window can be made focused and has been made focused(synchronously)
               // then we can proceed with children, otherwise we retreat.
               if (!(res && parentWindow.isFocused())) {
@@ -342,13 +350,17 @@
     }
 
     private boolean rejectFocusRequestHelper(String logMsg) {
-        if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(logMsg);
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer(logMsg);
+        }
         XKeyboardFocusManagerPeer.removeLastFocusRequest(target);
         return false;
     }
 
     void handleJavaFocusEvent(AWTEvent e) {
-        if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(e.toString());
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer(e.toString());
+        }
         if (e.getID() == FocusEvent.FOCUS_GAINED) {
             focusGained((FocusEvent)e);
         } else {
@@ -631,7 +643,9 @@
     }
 
     public void setBackground(Color c) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Set background to " + c);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Set background to " + c);
+        }
         synchronized (getStateLock()) {
             background = c;
         }
@@ -640,7 +654,9 @@
     }
 
     public void setForeground(Color c) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Set foreground to " + c);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Set foreground to " + c);
+        }
         synchronized (getStateLock()) {
             foreground = c;
         }
@@ -659,7 +675,9 @@
      * @since     JDK1.0
      */
     public FontMetrics getFontMetrics(Font font) {
-        if (fontLog.isLoggable(PlatformLogger.FINE)) fontLog.fine("Getting font metrics for " + font);
+        if (fontLog.isLoggable(PlatformLogger.FINE)) {
+            fontLog.fine("Getting font metrics for " + font);
+        }
         return sun.font.FontDesignMetrics.getMetrics(font);
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java	Fri Apr 12 14:33:38 2013 +0400
@@ -115,8 +115,10 @@
             if (in != null) {
                 newBounds.setLocation(-in.left, -in.top);
             }
-            if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting content bounds {0}, old bounds {1}",
-                                                                    newBounds, getBounds());
+            if (insLog.isLoggable(PlatformLogger.FINE)) {
+                insLog.fine("Setting content bounds {0}, old bounds {1}",
+                            newBounds, getBounds());
+            }
             // Fix for 5023533:
             // Change in the size of the content window means, well, change of the size
             // Change in the location of the content window means change in insets
--- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -78,7 +78,9 @@
         Rectangle bounds = (Rectangle)params.get(BOUNDS);
         dimensions = new WindowDimensions(bounds, getRealInsets(), false);
         params.put(BOUNDS, dimensions.getClientRect());
-        insLog.fine("Initial dimensions {0}", dimensions);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Initial dimensions {0}", dimensions);
+        }
 
         // Deny default processing of these events on the shell - proxy will take care of
         // them instead
@@ -179,7 +181,9 @@
     }
 
     public void setTitle(String title) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Title is " + title);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Title is " + title);
+        }
         winAttr.title = title;
         updateWMName();
     }
@@ -227,7 +231,9 @@
 
         // If we somehow received focus events forward it instead to proxy
         // FIXME: Shouldn't we instead check for inferrior?
-        focusLog.finer("Received focus event on shell: " + xfe);
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer("Received focus event on shell: " + xfe);
+        }
 //         focusProxy.xRequestFocus();
    }
 
@@ -269,7 +275,9 @@
             wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
         }
 
-        insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets);
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("FRAME_EXTENTS: {0}", wm_set_insets);
+        }
 
         if (wm_set_insets != null) {
             wm_set_insets = copy(wm_set_insets);
@@ -296,7 +304,9 @@
 
     public void handleReparentNotifyEvent(XEvent xev) {
         XReparentEvent  xe = xev.get_xreparent();
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine(xe.toString());
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine(xe.toString());
+        }
         reparent_serial = xe.get_serial();
         XToolkit.awtLock();
         try {
@@ -335,7 +345,9 @@
                 // Check if we have insets provided by the WM
                 Insets correctWM = getWMSetInsets(null);
                 if (correctWM != null) {
-                    insLog.finer("wm-provided insets {0}", correctWM);
+                    if (insLog.isLoggable(PlatformLogger.FINER)) {
+                        insLog.finer("wm-provided insets {0}", correctWM);
+                    }
                     // If these insets are equal to our current insets - no actions are necessary
                     Insets dimInsets = dimensions.getInsets();
                     if (correctWM.equals(dimInsets)) {
@@ -348,10 +360,12 @@
                 } else {
                     correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
 
-                    if (correctWM != null) {
-                        insLog.finer("correctWM {0}", correctWM);
-                    } else {
-                        insLog.finer("correctWM insets are not available, waiting for configureNotify");
+                    if (insLog.isLoggable(PlatformLogger.FINER)) {
+                        if (correctWM != null) {
+                            insLog.finer("correctWM {0}", correctWM);
+                        } else {
+                            insLog.finer("correctWM insets are not available, waiting for configureNotify");
+                        }
                     }
                 }
 
@@ -372,7 +386,9 @@
              * initial insets were wrong (most likely they were).
              */
             Insets correction = difference(correctWM, currentInsets);
-            insLog.finest("Corrention {0}", correction);
+            if (insLog.isLoggable(PlatformLogger.FINEST)) {
+                insLog.finest("Corrention {0}", correction);
+            }
             if (!isNull(correction)) {
                 currentInsets = copy(correctWM);
                 applyGuessedInsets();
@@ -382,7 +398,9 @@
                 //update minimum size hints
                 updateMinSizeHints();
             }
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Dimensions before reparent: " + dimensions);
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Dimensions before reparent: " + dimensions);
+            }
 
             dimensions.setInsets(getRealInsets());
             insets_corrected = true;
@@ -506,8 +524,10 @@
         XToolkit.awtLock();
         try {
             if (!isReparented() || !isVisible()) {
-                insLog.fine("- not reparented({0}) or not visible({1}), default reshape",
+                if (insLog.isLoggable(PlatformLogger.FINE)) {
+                    insLog.fine("- not reparented({0}) or not visible({1}), default reshape",
                            Boolean.valueOf(isReparented()), Boolean.valueOf(visible));
+                }
 
                 // Fix for 6323293.
                 // This actually is needed to preserve compatibility with previous releases -
@@ -612,9 +632,10 @@
               dims.setSize(width, height);
               break;
         }
-        if (insLog.isLoggable(PlatformLogger.FINE))
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
             insLog.fine("For the operation {0} new dimensions are {1}",
                         operationToString(operation), dims);
+        }
 
         reshape(dims, operation, userReshape);
     }
@@ -644,7 +665,9 @@
     public void handleConfigureNotifyEvent(XEvent xev) {
         assert (SunToolkit.isAWTLockHeldByCurrentThread());
         XConfigureEvent xe = xev.get_xconfigure();
-        insLog.fine("Configure notify {0}", xe);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Configure notify {0}", xe);
+        }
 
         // XXX: should really only consider synthetic events, but
         if (isReparented()) {
@@ -735,7 +758,9 @@
                 case XWM.SAWFISH_WM:
                 {
                     Point xlocation = queryXLocation();
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("New X location: {0}", xlocation);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("New X location: {0}", xlocation);
+                    }
                     if (xlocation != null) {
                         newLocation = xlocation;
                     }
@@ -752,8 +777,10 @@
                 copy(currentInsets),
                 true);
 
-        insLog.finer("Insets are {0}, new dimensions {1}",
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Insets are {0}, new dimensions {1}",
                      currentInsets, newDimensions);
+        }
 
         checkIfOnNewScreen(newDimensions.getBounds());
 
@@ -788,8 +815,9 @@
     }
 
     public void setShellBounds(Rectangle rec) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell bounds on " +
-                                                                this + " to " + rec);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell bounds on " + this + " to " + rec);
+        }
         XToolkit.awtLock();
         try {
             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
@@ -801,8 +829,9 @@
         }
     }
     public void setShellSize(Rectangle rec) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell size on " +
-                                                                this + " to " + rec);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell size on " + this + " to " + rec);
+        }
         XToolkit.awtLock();
         try {
             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
@@ -813,8 +842,9 @@
         }
     }
     public void setShellPosition(Rectangle rec) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell position on " +
-                                                                this + " to " + rec);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell position on " + this + " to " + rec);
+        }
         XToolkit.awtLock();
         try {
             updateSizeHints(rec.x, rec.y, rec.width, rec.height);
@@ -914,9 +944,10 @@
                 return toGlobal(0,0);
             } else {
                 Point location = target.getLocation();
-                if (insLog.isLoggable(PlatformLogger.FINE))
+                if (insLog.isLoggable(PlatformLogger.FINE)) {
                     insLog.fine("getLocationOnScreen {0} not reparented: {1} ",
                                 this, location);
+                }
                 return location;
             }
         } finally {
@@ -953,7 +984,9 @@
     }
 
     public void setVisible(boolean vis) {
-        log.finer("Setting {0} to visible {1}", this, Boolean.valueOf(vis));
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Setting {0} to visible {1}", this, Boolean.valueOf(vis));
+        }
         if (vis && !isVisible()) {
             XWM.setShellDecor(this);
             super.setVisible(vis);
@@ -1004,7 +1037,9 @@
     }
 
     private void handleWmTakeFocus(XClientMessageEvent cl) {
-        focusLog.fine("WM_TAKE_FOCUS on {0}", this);
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+            focusLog.fine("WM_TAKE_FOCUS on {0}", this);
+        }
         requestWindowFocus(cl.get_data(1), true);
     }
 
@@ -1017,9 +1052,13 @@
         // by "proxy" - invisible mapped window. When we want to set X input focus to
         // toplevel set it on proxy instead.
         if (focusProxy == null) {
-            if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.warning("Focus proxy is null for " + this);
+            if (focusLog.isLoggable(PlatformLogger.WARNING)) {
+                focusLog.warning("Focus proxy is null for " + this);
+            }
         } else {
-            if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Requesting focus to proxy: " + focusProxy);
+            if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                focusLog.fine("Requesting focus to proxy: " + focusProxy);
+            }
             if (timeProvided) {
                 focusProxy.xRequestFocus(time);
             } else {
@@ -1111,9 +1150,11 @@
         Window focusedWindow = XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow();
         Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
-        focusLog.finer("Current window is: active={0}, focused={1}",
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer("Current window is: active={0}, focused={1}",
                        Boolean.valueOf(target == activeWindow),
                        Boolean.valueOf(target == focusedWindow));
+        }
 
         XWindowPeer toFocus = this;
         while (toFocus.nextTransientFor != null) {
@@ -1136,16 +1177,22 @@
                 return true;
             }
             Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();
-            focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
+            if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+                focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
                             "\nKFM's focused window: " + focusedWindow);
+            }
 
             // See 6522725, 6613426.
             if (target == realNativeFocusedWindow) {
-                focusLog.fine("The window is already natively focused.");
+                if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                    focusLog.fine("The window is already natively focused.");
+                }
                 return true;
             }
         }
-        focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+            focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
+        }
 
         if (timeProvided) {
             toFocus.requestXFocus(time);
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -123,7 +123,9 @@
     }
 
     void initDispatching() {
-        if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Init embedding for " + Long.toHexString(xembed.handle));
+        if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+            xembedLog.fine("Init embedding for " + Long.toHexString(xembed.handle));
+        }
         XToolkit.awtLock();
         try {
             XToolkit.addEventDispatcher(xembed.handle, xembed);
@@ -140,7 +142,9 @@
     }
 
     void endDispatching() {
-        xembedLog.fine("End dispatching for " + Long.toHexString(xembed.handle));
+        if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+            xembedLog.fine("End dispatching for " + Long.toHexString(xembed.handle));
+        }
         XToolkit.awtLock();
         try {
             XDropTargetRegistry.getRegistry().unregisterXEmbedClient(getWindow(), xembed.handle);
@@ -160,7 +164,9 @@
     }
 
     void childDestroyed() {
-        xembedLog.fine("Child " + Long.toHexString(xembed.handle) + " has self-destroyed.");
+        if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+            xembedLog.fine("Child " + Long.toHexString(xembed.handle) + " has self-destroyed.");
+        }
         endDispatching();
         xembed.handle = 0;
     }
@@ -382,7 +388,9 @@
     }
 
     void detachChild() {
-        if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Detaching child " + Long.toHexString(xembed.handle));
+        if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+            xembedLog.fine("Detaching child " + Long.toHexString(xembed.handle));
+        }
         /**
          *  XEmbed specification:
          *  "The embedder can unmap the client and reparent the client window to the root window. If the
@@ -463,7 +471,9 @@
         try {
             XKeyEvent ke = new XKeyEvent(data);
             ke.set_window(xembed.handle);
-            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Forwarding native key event: " + ke);
+            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                xembedLog.fine("Forwarding native key event: " + ke);
+            }
             XToolkit.awtLock();
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XConstants.NoEventMask, data);
@@ -494,7 +504,9 @@
         postEvent(new InvocationEvent(target, new Runnable() {
                 public void run() {
                     GrabbedKey grab = new GrabbedKey(keysym, modifiers);
-                    if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Grabbing key: " + grab);
+                    if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                        xembedLog.fine("Grabbing key: " + grab);
+                    }
                     synchronized(GRAB_LOCK) {
                         grabbed_keys.add(grab);
                     }
@@ -506,7 +518,9 @@
         postEvent(new InvocationEvent(target, new Runnable() {
                 public void run() {
                     GrabbedKey grab = new GrabbedKey(keysym, modifiers);
-                    if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("UnGrabbing key: " + grab);
+                    if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                        xembedLog.fine("UnGrabbing key: " + grab);
+                    }
                     synchronized(GRAB_LOCK) {
                         grabbed_keys.remove(grab);
                     }
@@ -519,7 +533,9 @@
                 public void run() {
                     AWTKeyStroke stroke = xembed.getKeyStrokeForKeySym(keysym, modifiers);
                     if (stroke != null) {
-                        if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Registering accelerator " + accel_id + " for " + stroke);
+                        if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                            xembedLog.fine("Registering accelerator " + accel_id + " for " + stroke);
+                        }
                         synchronized(ACCEL_LOCK) {
                             accelerators.put(accel_id, stroke);
                             accel_lookup.put(stroke, accel_id);
@@ -537,7 +553,9 @@
                     synchronized(ACCEL_LOCK) {
                         stroke = accelerators.get(accel_id);
                         if (stroke != null) {
-                            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Unregistering accelerator: " + accel_id);
+                            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                                xembedLog.fine("Unregistering accelerator: " + accel_id);
+                            }
                             accelerators.remove(accel_id);
                             accel_lookup.remove(stroke); // FIXME: How about several accelerators with the same stroke?
                         }
@@ -583,7 +601,9 @@
 
         boolean result = false;
 
-        if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Post-processing event " + e);
+        if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+            xembedLog.finer("Post-processing event " + e);
+        }
 
         // Process ACCELERATORS
         AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e);
@@ -596,7 +616,9 @@
             }
         }
         if (exists) {
-            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Activating accelerator " + accel_id);
+            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                xembedLog.fine("Activating accelerator " + accel_id);
+            }
             xembed.sendMessage(xembed.handle, XEMBED_ACTIVATE_ACCELERATOR, accel_id, 0, 0); // FIXME: How about overloaded?
             result = true;
         }
@@ -608,7 +630,9 @@
             exists = grabbed_keys.contains(key);
         }
         if (exists) {
-            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Forwarding grabbed key " + e);
+            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                xembedLog.fine("Forwarding grabbed key " + e);
+            }
             forwardKeyEvent(e);
             result = true;
         }
@@ -627,9 +651,13 @@
     public void handleClientMessage(XEvent xev) {
         super.handleClientMessage(xev);
         XClientMessageEvent msg = xev.get_xclient();
-        if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Client message to embedder: " + msg);
+        if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+            xembedLog.finer("Client message to embedder: " + msg);
+        }
         if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
-            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine(xembed.XEmbedMessageToString(msg));
+            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                xembedLog.fine(xembed.XEmbedMessageToString(msg));
+            }
         }
         if (isXEmbedActive()) {
             switch ((int)msg.get_data(1)) {
@@ -730,8 +758,9 @@
                 boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
                 boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
                 if (new_mapped != currently_mapped) {
-                    if (xembedLog.isLoggable(PlatformLogger.FINER))
-                        xembedLog.fine("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
+                    if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                        xembedLog.finer("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
+                    }
                     if (new_mapped) {
                         XToolkit.awtLock();
                         try {
@@ -748,7 +777,9 @@
                         }
                     }
                 } else {
-                    xembedLog.finer("Mapping state didn't change, mapped: " + currently_mapped);
+                    if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                        xembedLog.finer("Mapping state didn't change, mapped: " + currently_mapped);
+                    }
                 }
                 return true;
             } finally {
@@ -759,7 +790,9 @@
         public void handlePropertyNotify(XEvent xev) {
             if (isXEmbedActive()) {
                 XPropertyEvent ev = xev.get_xproperty();
-                if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Property change on client: " + ev);
+                if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                    xembedLog.finer("Property change on client: " + ev);
+                }
                 if (ev.get_atom() == XAtom.XA_WM_NORMAL_HINTS) {
                     childResized();
                 } else if (ev.get_atom() == XEmbedInfo.getAtom()) {
@@ -780,7 +813,9 @@
         void handleConfigureNotify(XEvent xev) {
             if (isXEmbedActive()) {
                 XConfigureEvent ev = xev.get_xconfigure();
-                if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Bounds change on client: " + ev);
+                if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                    xembedLog.finer("Bounds change on client: " + ev);
+                }
                 if (xev.get_xany().get_window() == handle) {
                     childResized();
                 }
@@ -831,7 +866,9 @@
 
                 // We recognize only these masks
                 modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask);
-                if (xembedLog.isLoggable(PlatformLogger.FINEST)) xembedLog.finest("Mapped " + e + " to " + this);
+                if (xembedLog.isLoggable(PlatformLogger.FINEST)) {
+                    xembedLog.finest("Mapped " + e + " to " + this);
+                }
             } finally {
                 XlibWrapper.unsafe.freeMemory(data);
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Fri Apr 12 14:33:38 2013 +0400
@@ -95,9 +95,13 @@
 
     void handleClientMessage(XEvent xev) {
         XClientMessageEvent msg = xev.get_xclient();
-        if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine(msg.toString());
+        if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+            xembedLog.fine(msg.toString());
+        }
         if (msg.get_message_type() == XEmbed.getAtom()) {
-            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Embedded message: " + msgidToString((int)msg.get_data(1)));
+            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                xembedLog.fine("Embedded message: " + msgidToString((int)msg.get_data(1)));
+            }
             switch ((int)msg.get_data(1)) {
               case XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
                   active = true;
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java	Fri Apr 12 14:33:38 2013 +0400
@@ -82,11 +82,15 @@
     XEmbedHelper() {
         if (XEmbed == null) {
             XEmbed = XAtom.get("_XEMBED");
-            if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Created atom " + XEmbed.toString());
+            if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                xembedLog.finer("Created atom " + XEmbed.toString());
+            }
         }
         if (XEmbedInfo == null) {
             XEmbedInfo = XAtom.get("_XEMBED_INFO");
-            if (xembedLog.isLoggable(PlatformLogger.FINER)) xembedLog.finer("Created atom " + XEmbedInfo.toString());
+            if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                xembedLog.finer("Created atom " + XEmbedInfo.toString());
+            }
         }
     }
 
@@ -106,7 +110,9 @@
         msg.set_data(4, data2);
         XToolkit.awtLock();
         try {
-            if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Sending " + XEmbedMessageToString(msg));
+            if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                xembedLog.fine("Sending " + XEmbedMessageToString(msg));
+            }
             XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData);
         }
         finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java	Fri Apr 12 14:33:38 2013 +0400
@@ -81,7 +81,9 @@
             throw new RuntimeException("Can't create robot");
         }
         initAccel();
-        xembedLog.finer("XEmbed client(tester), embedder window: " + Long.toHexString(parent));
+        if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+            xembedLog.finer("XEmbed client(tester), embedder window: " + Long.toHexString(parent));
+        }
     }
 
     public static XEmbedServerTester getTester(Rectangle serverBounds[], long parent) {
@@ -89,12 +91,14 @@
     }
 
     private void dumpReceivedEvents() {
-        xembedLog.finer("Events received so far:");
-        int pos = 0;
-        for (Integer event : events) {
-            xembedLog.finer((pos++) + ":" + XEmbedHelper.msgidToString(event));
+        if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+            xembedLog.finer("Events received so far:");
+            int pos = 0;
+            for (Integer event : events) {
+                xembedLog.finer((pos++) + ":" + XEmbedHelper.msgidToString(event));
+            }
+            xembedLog.finer("End of event dump");
         }
-        xembedLog.finer("End of event dump");
     }
 
     public void test1_1() {
@@ -391,7 +395,9 @@
                                                      SubstructureNotifyMask | KeyPressMask)});
             window = new XBaseWindow(params);
 
-            xembedLog.finer("Created tester window: " + window);
+            if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                xembedLog.finer("Created tester window: " + window);
+            }
 
             XToolkit.addEventDispatcher(window.getWindow(), this);
             updateEmbedInfo();
@@ -529,18 +535,24 @@
         synchronized(EVENT_LOCK) {
             // Check for already received events after the request
             if (checkEventList(position, event) != -1) {
-                xembedLog.finer("The event " + XEmbedHelper.msgidToString(event) + " has already been received");
+                if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                    xembedLog.finer("The event " + XEmbedHelper.msgidToString(event) + " has already been received");
+                }
                 return;
             }
 
             if (eventReceived == event) {
                 // Already received
-                xembedLog.finer("Already received " + XEmbedHelper.msgidToString(event));
+                if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                    xembedLog.finer("Already received " + XEmbedHelper.msgidToString(event));
+                }
                 return;
             }
             eventReceived = -1;
             eventWaited = event;
-            xembedLog.finer("Waiting for " + XEmbedHelper.msgidToString(event) + " starting from " + position);
+            if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                xembedLog.finer("Waiting for " + XEmbedHelper.msgidToString(event) + " starting from " + position);
+            }
             try {
                 EVENT_LOCK.wait(3000);
             } catch (InterruptedException ie) {
@@ -551,7 +563,9 @@
                 dumpReceivedEvents();
                 throw new RuntimeException("Didn't receive event " + XEmbedHelper.msgidToString(event) + " but recevied " + XEmbedHelper.msgidToString(eventReceived));
             } else {
-                xembedLog.finer("Successfully recevied " + XEmbedHelper.msgidToString(event));
+                if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                    xembedLog.finer("Successfully recevied " + XEmbedHelper.msgidToString(event));
+                }
             }
         }
     }
@@ -634,7 +648,9 @@
         if (ev.get_type() == ClientMessage) {
             XClientMessageEvent msg = ev.get_xclient();
             if (msg.get_message_type() == xembed.XEmbed.getAtom()) {
-                if (xembedLog.isLoggable(PlatformLogger.FINE)) xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1)));
+                if (xembedLog.isLoggable(PlatformLogger.FINE)) {
+                    xembedLog.fine("Embedded message: " + XEmbedHelper.msgidToString((int)msg.get_data(1)));
+                }
                 switch ((int)msg.get_data(1)) {
                   case XEmbedHelper.XEMBED_EMBEDDED_NOTIFY: // Notification about embedding protocol start
                       xembedActive = true;
@@ -659,10 +675,14 @@
                 synchronized(EVENT_LOCK) {
                     events.add((int)msg.get_data(1));
 
-                    xembedLog.finer("Tester is waiting for " +  XEmbedHelper.msgidToString(eventWaited));
+                    if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                        xembedLog.finer("Tester is waiting for " +  XEmbedHelper.msgidToString(eventWaited));
+                    }
                     if ((int)msg.get_data(1) == eventWaited) {
                         eventReceived = (int)msg.get_data(1);
-                        xembedLog.finer("Notifying waiting object for event " + System.identityHashCode(EVENT_LOCK));
+                        if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                            xembedLog.finer("Notifying waiting object for event " + System.identityHashCode(EVENT_LOCK));
+                        }
                         EVENT_LOCK.notifyAll();
                     }
                 }
@@ -672,10 +692,14 @@
                 int eventID = (int)ev.get_type() | SYSTEM_EVENT_MASK;
                 events.add(eventID);
 
-                xembedLog.finer("Tester is waiting for " + XEmbedHelper.msgidToString(eventWaited) + ", but we received " + ev + "(" + XEmbedHelper.msgidToString(eventID) + ")");
+                if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                    xembedLog.finer("Tester is waiting for " + XEmbedHelper.msgidToString(eventWaited) + ", but we received " + ev + "(" + XEmbedHelper.msgidToString(eventID) + ")");
+                }
                 if (eventID == eventWaited) {
                     eventReceived = eventID;
-                    xembedLog.finer("Notifying waiting object" + System.identityHashCode(EVENT_LOCK));
+                    if (xembedLog.isLoggable(PlatformLogger.FINER)) {
+                        xembedLog.finer("Notifying waiting object" + System.identityHashCode(EVENT_LOCK));
+                    }
                     EVENT_LOCK.notifyAll();
                 }
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -720,7 +720,9 @@
         }
 
         File fe = new File(dir).getAbsoluteFile();
-        log.fine("Current directory : " + fe);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Current directory : " + fe);
+        }
 
         if (!fe.isDirectory()) {
             dir = "./";
--- a/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -209,7 +209,9 @@
     }
 
     public void setMaximizedBounds(Rectangle b) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting maximized bounds to " + b);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting maximized bounds to " + b);
+        }
         if (b == null) return;
         maxBounds = new Rectangle(b);
         XToolkit.awtLock();
@@ -226,7 +228,9 @@
             } else {
                 hints.set_max_height((int)XlibWrapper.DisplayHeight(XToolkit.getDisplay(), XlibWrapper.DefaultScreen(XToolkit.getDisplay())));
             }
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
+            }
             XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), window, hints.pData);
         } finally {
             XToolkit.awtUnlock();
@@ -254,14 +258,20 @@
         int changed = state ^ newState;
         int changeIconic = changed & Frame.ICONIFIED;
         boolean iconic = (newState & Frame.ICONIFIED) != 0;
-        stateLog.finer("Changing state, old state {0}, new state {1}(iconic {2})",
+        if (stateLog.isLoggable(PlatformLogger.FINER)) {
+            stateLog.finer("Changing state, old state {0}, new state {1}(iconic {2})",
                        Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(iconic));
+        }
         if (changeIconic != 0 && iconic) {
-            if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("Iconifying shell " + getShell() + ", this " + this + ", screen " + getScreenNumber());
+            if (stateLog.isLoggable(PlatformLogger.FINER)) {
+                stateLog.finer("Iconifying shell " + getShell() + ", this " + this + ", screen " + getScreenNumber());
+            }
             XToolkit.awtLock();
             try {
                 int res = XlibWrapper.XIconifyWindow(XToolkit.getDisplay(), getShell(), getScreenNumber());
-                if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("XIconifyWindow returned " + res);
+                if (stateLog.isLoggable(PlatformLogger.FINER)) {
+                    stateLog.finer("XIconifyWindow returned " + res);
+                }
             }
             finally {
                 XToolkit.awtUnlock();
@@ -271,7 +281,9 @@
             setExtendedState(newState);
         }
         if (changeIconic != 0 && !iconic) {
-            if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("DeIconifying " + this);
+            if (stateLog.isLoggable(PlatformLogger.FINER)) {
+                stateLog.finer("DeIconifying " + this);
+            }
             xSetVisible(true);
         }
     }
@@ -284,7 +296,9 @@
         super.handlePropertyNotify(xev);
         XPropertyEvent ev = xev.get_xproperty();
 
-        log.finer("Property change {0}", ev);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Property change {0}", ev);
+        }
         /*
          * Let's see if this is a window state protocol message, and
          * if it is - decode a new state in terms of java constants.
@@ -297,7 +311,9 @@
         final int newState = XWM.getWM().getState(this);
         int changed = state ^ newState;
         if (changed == 0) {
-            stateLog.finer("State is the same: " + state);
+            if (stateLog.isLoggable(PlatformLogger.FINER)) {
+                stateLog.finer("State is the same: " + state);
+            }
             return;
         }
 
@@ -349,7 +365,9 @@
             XWMHints hints = getWMHints();
             hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
             hints.set_initial_state(wm_state);
-            if (stateLog.isLoggable(PlatformLogger.FINE)) stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
+            if (stateLog.isLoggable(PlatformLogger.FINE)) {
+                stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
+            }
             XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
         }
         finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java	Fri Apr 12 14:33:38 2013 +0400
@@ -61,7 +61,9 @@
             final long screen = adata.get_awt_visInfo().get_screen();
             final long display = XToolkit.getDisplay();
 
-            if (log.isLoggable(PlatformLogger.FINEST)) log.finest(adata.toString());
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest(adata.toString());
+            }
 
             long status =
                 XlibWrapper.XGetIconSizes(display, XToolkit.getDefaultRootWindow(),
@@ -71,11 +73,15 @@
             }
             int count = Native.getInt(XlibWrapper.iarg1);
             long sizes_ptr = Native.getLong(XlibWrapper.larg1); // XIconSize*
-            log.finest("count = {1}, sizes_ptr = {0}", Long.valueOf(sizes_ptr), Integer.valueOf(count));
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest("count = {1}, sizes_ptr = {0}", Long.valueOf(sizes_ptr), Integer.valueOf(count));
+            }
             XIconSize[] res = new XIconSize[count];
             for (int i = 0; i < count; i++, sizes_ptr += XIconSize.getSize()) {
                 res[i] = new XIconSize(sizes_ptr);
-                log.finest("sizes_ptr[{1}] = {0}", res[i], Integer.valueOf(i));
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("sizes_ptr[{1}] = {0}", res[i], Integer.valueOf(i));
+                }
             }
             return res;
         } finally {
@@ -92,7 +98,9 @@
         }
 
         XIconSize[] sizeList = getIconSizes();
-        log.finest("Icon sizes: {0}", (Object[]) sizeList);
+        if (log.isLoggable(PlatformLogger.FINEST)) {
+            log.finest("Icon sizes: {0}", (Object[]) sizeList);
+        }
         if (sizeList == null) {
             // No icon sizes so we simply fall back to 16x16
             return new Dimension(16, 16);
@@ -418,7 +426,9 @@
             }
         }
         if (min != null) {
-            log.finer("Icon: {0}x{1}", min.getWidth(null), min.getHeight(null));
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Icon: {0}x{1}", min.getWidth(null), min.getHeight(null));
+            }
             setIconImage(min);
         }
     }
@@ -444,7 +454,9 @@
             }
             Dimension iconSize = getIconSize(width, height);
             if (iconSize != null) {
-                log.finest("Icon size: {0}", iconSize);
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("Icon size: {0}", iconSize);
+                }
                 iconWidth = iconSize.width;
                 iconHeight = iconSize.height;
             } else {
--- a/jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XInputMethod.java	Fri Apr 12 14:33:38 2013 +0400
@@ -102,13 +102,17 @@
     protected ComponentPeer getPeer(Component client) {
         XComponentPeer peer;
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Client is " + client);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Client is " + client);
+        }
         peer = (XComponentPeer)XToolkit.targetToPeer(client);
         while (client != null && peer == null) {
             client = getParent(client);
             peer = (XComponentPeer)XToolkit.targetToPeer(client);
         }
-        log.fine("Peer is {0}, client is {1}", peer, client);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Peer is {0}, client is {1}", peer, client);
+        }
 
         if (peer != null)
             return peer;
--- a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -575,10 +575,14 @@
     }
 
     void mousePressed(MouseEvent mouseEvent) {
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer(mouseEvent.toString() + ", hsb " + hsbVis + ", vsb " + vsbVis);
+        }
         if (isEnabled() && mouseEvent.getButton() == MouseEvent.BUTTON1) {
             if (inWindow(mouseEvent.getX(), mouseEvent.getY())) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Mouse press in items area");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Mouse press in items area");
+                }
                 active = WINDOW;
                 int i = y2index(mouseEvent.getY());
                 if (i >= 0) {
@@ -615,14 +619,18 @@
                     currentIndex = -1;
                 }
             } else if (inVerticalScrollbar(mouseEvent.getX(), mouseEvent.getY())) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Mouse press in vertical scrollbar");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Mouse press in vertical scrollbar");
+                }
                 active = VERSCROLLBAR;
                 vsb.handleMouseEvent(mouseEvent.getID(),
                                      mouseEvent.getModifiers(),
                                      mouseEvent.getX() - (width - SCROLLBAR_WIDTH),
                                      mouseEvent.getY());
             } else if (inHorizontalScrollbar(mouseEvent.getX(), mouseEvent.getY())) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Mouse press in horizontal scrollbar");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Mouse press in horizontal scrollbar");
+                }
                 active = HORSCROLLBAR;
                 hsb.handleMouseEvent(mouseEvent.getID(),
                                      mouseEvent.getModifiers(),
@@ -805,7 +813,9 @@
 
     void keyPressed(KeyEvent e) {
         int keyCode = e.getKeyCode();
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine(e.toString());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine(e.toString());
+        }
         switch(keyCode) {
           case KeyEvent.VK_UP:
           case KeyEvent.VK_KP_UP: // TODO: I assume we also want this, too
@@ -990,7 +1000,9 @@
      */
     public void notifyValue(XScrollbar obj, int type, int v, boolean isAdjusting) {
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Notify value changed on " + obj + " to " + v);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Notify value changed on " + obj + " to " + v);
+        }
         int value = obj.getValue();
         if (obj == vsb) {
             scrollVertical(v - value);
@@ -1073,7 +1085,9 @@
                 }
             }
         }
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer("Adding item '" + item + "' to " + addedIndex);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Adding item '" + item + "' to " + addedIndex);
+        }
 
         // Update maxLength
         boolean repaintItems = !isItemHidden(addedIndex);
@@ -1091,8 +1105,10 @@
                 | ((vsb.needsRepaint())?(PAINT_VSCROLL):0);
 
         }
-        if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Last visible: " + getLastVisibleItem() +
-                                                     ", hsb changed : " + (hsbWasVis ^ hsbVis) + ", items changed " + repaintItems);
+        if (log.isLoggable(PlatformLogger.FINEST)) {
+            log.finest("Last visible: " + getLastVisibleItem() +
+            ", hsb changed : " + (hsbWasVis ^ hsbVis) + ", items changed " + repaintItems);
+        }
         repaint(addedIndex, getLastVisibleItem(), options);
     }
 
@@ -1107,10 +1123,14 @@
         boolean vsbWasVisible = vsbVis;
         int oldLastDisplayed = lastItemDisplayed();
 
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Deleting from " + s + " to " + e);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Deleting from " + s + " to " + e);
+        }
 
-        if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Last displayed item: " + oldLastDisplayed + ", items in window " + itemsInWindow() +
-                                                     ", size " + items.size());
+        if (log.isLoggable(PlatformLogger.FINEST)) {
+            log.finest("Last displayed item: " + oldLastDisplayed + ", items in window " + itemsInWindow() +
+            ", size " + items.size());
+        }
 
         if (items.size() == 0) {
             return;
@@ -1177,7 +1197,9 @@
             options |= PAINT_FOCUS;
         }
 
-        if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Multiple selections: " + multipleSelections);
+        if (log.isLoggable(PlatformLogger.FINEST)) {
+            log.finest("Multiple selections: " + multipleSelections);
+        }
 
         // update vsb.val
         if (vsb.getValue() >= s) {
@@ -1430,7 +1452,9 @@
      * y is the number of items to scroll
      */
     void scrollVertical(int y) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Scrolling vertically by " + y);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Scrolling vertically by " + y);
+        }
         int itemsInWin = itemsInWindow();
         int h = getItemHeight();
         int pixelsToScroll = y * h;
@@ -1470,7 +1494,9 @@
      * x is the number of pixels to scroll
      */
     void scrollHorizontal(int x) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Scrolling horizontally by " + y);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Scrolling horizontally by " + y);
+        }
         int w = getListWidth();
         w -= ((2 * SPACE) + (2 * MARGIN));
         int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
@@ -1706,7 +1732,9 @@
             }
 
             if (localBuffer == null) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Creating buffer " + width + "x" + height);
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Creating buffer " + width + "x" + height);
+                }
                 // use GraphicsConfig.cCVI() instead of Component.cVI(),
                 // because the latter may cause a deadlock with the tree lock
                 localBuffer =
@@ -1743,7 +1771,9 @@
 
         private void paint(Graphics listG, int firstItem, int lastItem, int options,
                            Rectangle source, Point distance) {
-            if (log.isLoggable(PlatformLogger.FINER)) log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
+            }
             if (firstItem > lastItem) {
                 int t = lastItem;
                 lastItem = firstItem;
@@ -1832,7 +1862,9 @@
         }
 
         private void paintItems(Graphics g, int firstItem, int lastItem, int options) {
-            if (log.isLoggable(PlatformLogger.FINER)) log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
+            }
 
             firstItem = Math.max(getFirstVisibleItem(), firstItem);
             if (firstItem > lastItem) {
@@ -1843,15 +1875,19 @@
             firstItem = Math.max(getFirstVisibleItem(), firstItem);
             lastItem = Math.min(lastItem, items.size()-1);
 
-            if (log.isLoggable(PlatformLogger.FINER)) log.finer("Actually painting items from " + firstItem + " to " + lastItem +
-                                                       ", items in window " + itemsInWindow());
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Actually painting items from " + firstItem + " to " + lastItem +
+                          ", items in window " + itemsInWindow());
+            }
             for (int i = firstItem; i <= lastItem; i++) {
                 paintItem(g, i);
             }
         }
 
         private void paintItem(Graphics g, int index) {
-            if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting item " + index);
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest("Painting item " + index);
+            }
             // 4895367 - only paint items which are visible
             if (!isItemHidden(index)) {
                 Shape clip = g.getClip();
@@ -1859,18 +1895,24 @@
                 int h = getItemHeight();
                 int y = getItemY(index);
                 int x = getItemX();
-                if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Setting clip " + new Rectangle(x, y, w - (SPACE*2), h-(SPACE*2)));
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("Setting clip " + new Rectangle(x, y, w - (SPACE*2), h-(SPACE*2)));
+                }
                 g.setClip(x, y, w - (SPACE*2), h-(SPACE*2));
 
                 // Always paint the background so that focus is unpainted in
                 // multiselect mode
                 if (isSelected(index)) {
-                    if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painted item is selected");
+                    if (log.isLoggable(PlatformLogger.FINEST)) {
+                        log.finest("Painted item is selected");
+                    }
                     g.setColor(getListForeground());
                 } else {
                     g.setColor(getListBackground());
                 }
-                if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Filling " + new Rectangle(x, y, w, h));
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("Filling " + new Rectangle(x, y, w, h));
+                }
                 g.fillRect(x, y, w, h);
 
                 if (index <= getLastVisibleItem() && index < items.size()) {
@@ -1894,8 +1936,10 @@
         }
 
         void paintScrollBar(XScrollbar scr, Graphics g, int x, int y, int width, int height, boolean paintAll) {
-            if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting scrollbar " + scr + " width " +
-                                                         width + " height " + height + ", paintAll " + paintAll);
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest("Painting scrollbar " + scr + " width " +
+                width + " height " + height + ", paintAll " + paintAll);
+            }
             g.translate(x, y);
             scr.paint(g, getSystemColors(), paintAll);
             g.translate(-x, -y);
@@ -1932,22 +1976,30 @@
             if (paintFocus && !hasFocus()) {
                 paintFocus = false;
             }
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " +
-                                                     (isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Painting focus, focus index " + getFocusIndex() + ", focus is " +
+                         (isItemHidden(getFocusIndex())?("invisible"):("visible")) + ", paint focus is " + paintFocus);
+            }
             Shape clip = g.getClip();
             g.setClip(0, 0, listWidth, listHeight);
-            if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Setting focus clip " + new Rectangle(0, 0, listWidth, listHeight));
+            if (log.isLoggable(PlatformLogger.FINEST)) {
+                log.finest("Setting focus clip " + new Rectangle(0, 0, listWidth, listHeight));
+            }
             Rectangle rect = getFocusRect();
             if (prevFocusRect != null) {
                 // Erase focus rect
-                if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Erasing previous focus rect " + prevFocusRect);
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("Erasing previous focus rect " + prevFocusRect);
+                }
                 g.setColor(getListBackground());
                 g.drawRect(prevFocusRect.x, prevFocusRect.y, prevFocusRect.width, prevFocusRect.height);
                 prevFocusRect = null;
             }
             if (paintFocus) {
                 // Paint new
-                if (log.isLoggable(PlatformLogger.FINEST)) log.finest("Painting focus rect " + rect);
+                if (log.isLoggable(PlatformLogger.FINEST)) {
+                    log.finest("Painting focus rect " + rect);
+                }
                 g.setColor(getListForeground());  // Focus color is always black on Linux
                 g.drawRect(rect.x, rect.y, rect.width, rect.height);
                 prevFocusRect = rect;
--- a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java	Fri Apr 12 14:33:38 2013 +0400
@@ -128,7 +128,9 @@
             long display = XToolkit.getDisplay();
             synchronized(this) {
                 setOwner(owner, screen);
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("New Selection Owner for screen " + screen + " = " + owner );
+                }
                 XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
                 XToolkit.addEventDispatcher(owner,
                         new XEventDispatcher() {
@@ -148,19 +150,25 @@
         try {
             try {
                 long display = XToolkit.getDisplay();
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Grabbing XServer");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Grabbing XServer");
+                }
                 XlibWrapper.XGrabServer(display);
 
                 synchronized(this) {
                     String selection_name = getName()+"_S"+screen;
-                    if (log.isLoggable(PlatformLogger.FINE)) log.fine("Screen = " + screen + " selection name = " + selection_name);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("Screen = " + screen + " selection name = " + selection_name);
+                    }
                     XAtom atom = XAtom.get(selection_name);
                     selectionMap.put(Long.valueOf(atom.getAtom()),this); // add mapping from atom to the instance of XMSelection
                     setAtom(atom,screen);
                     long owner = XlibWrapper.XGetSelectionOwner(display, atom.getAtom());
                     if (owner != 0) {
                         setOwner(owner, screen);
-                        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
+                        if (log.isLoggable(PlatformLogger.FINE)) {
+                            log.fine("Selection Owner for screen " + screen + " = " + owner );
+                        }
                         XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
                         XToolkit.addEventDispatcher(owner,
                                 new XEventDispatcher() {
@@ -175,7 +183,9 @@
                 e.printStackTrace();
             }
             finally {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("UnGrabbing XServer");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("UnGrabbing XServer");
+                }
                 XlibWrapper.XUngrabServer(XToolkit.getDisplay());
             }
         } finally {
@@ -187,7 +197,9 @@
     static boolean processClientMessage(XEvent xev, int screen) {
         XClientMessageEvent xce = xev.get_xclient();
         if (xce.get_message_type() == XA_MANAGER.getAtom()) {
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("client messags = " + xce);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("client messags = " + xce);
+            }
             long timestamp = xce.get_data(0);
             long atom = xce.get_data(1);
             long owner = xce.get_data(2);
@@ -294,7 +306,9 @@
 
 
     synchronized void dispatchSelectionChanged( XPropertyEvent ev, int screen) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Selection Changed : Screen = " + screen + "Event =" + ev);
+        }
         if (listeners != null) {
             Iterator iter = listeners.iterator();
             while (iter.hasNext()) {
@@ -305,7 +319,9 @@
     }
 
     synchronized void dispatchOwnerDeath(XDestroyWindowEvent de, int screen) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Owner dead : Screen = " + screen + "Event =" + de);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Owner dead : Screen = " + screen + "Event =" + de);
+        }
         if (listeners != null) {
             Iterator iter = listeners.iterator();
             while (iter.hasNext()) {
@@ -317,7 +333,9 @@
     }
 
     void dispatchSelectionEvent(XEvent xev, int screen) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Event =" + xev);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Event =" + xev);
+        }
         if (xev.get_type() == XConstants.DestroyNotify) {
             XDestroyWindowEvent de = xev.get_xdestroywindow();
             dispatchOwnerDeath( de, screen);
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -519,7 +519,9 @@
      */
     public void handleKeyPress(XEvent xev) {
         XKeyEvent xkey = xev.get_xkey();
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine(xkey.toString());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine(xkey.toString());
+        }
         if (isEventDisabled(xev)) {
             return;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMenuPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -111,7 +111,9 @@
      * for adding separators
      */
     public void addSeparator() {
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer("addSeparator is not implemented");
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("addSeparator is not implemented");
+        }
     }
 
     public void addItem(MenuItem item) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	Fri Apr 12 14:33:38 2013 +0400
@@ -43,7 +43,9 @@
     }
 
     public void setState(XWindowPeer window, int state) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting state of " + window + " to " + state);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Setting state of " + window + " to " + state);
+        }
         if (window.isShowing()) {
             requestState(window, state);
         } else {
@@ -53,7 +55,9 @@
 
     private void setInitialState(XWindowPeer window, int state) {
         XAtomList old_state = window.getNETWMState();
-        log.fine("Current state of the window {0} is {1}", window, old_state);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Current state of the window {0} is {1}", window, old_state);
+        }
         if ((state & Frame.MAXIMIZED_VERT) != 0) {
             old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT);
         } else {
@@ -64,7 +68,9 @@
         } else {
             old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ);
         }
-        log.fine("Setting initial state of the window {0} to {1}", window, old_state);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Setting initial state of the window {0} to {1}", window, old_state);
+        }
         window.setNETWMState(old_state);
     }
 
@@ -97,7 +103,9 @@
               default:
                   return;
             }
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("Requesting state on " + window + " for " + state);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Requesting state on " + window + " for " + state);
+            }
             req.set_type((int)XConstants.ClientMessage);
             req.set_window(window.getWindow());
             req.set_message_type(XA_NET_WM_STATE.getAtom());
@@ -179,7 +187,9 @@
             req.set_data(1, state.getAtom());
             // Fix for 6735584: req.data[2] must be set to 0 when only one property is changed
             req.set_data(2, 0);
-            log.fine("Setting _NET_STATE atom {0} on {1} for {2}", state, window, Boolean.valueOf(isAdd));
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Setting _NET_STATE atom {0} on {1} for {2}", state, window, Boolean.valueOf(isAdd));
+            }
             XToolkit.awtLock();
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
@@ -204,20 +214,26 @@
      * @param reset Indicates operation, 'set' if false, 'reset' if true
      */
     private void setStateHelper(XWindowPeer window, XAtom state, boolean set) {
-        log.finer("Window visibility is: withdrawn={0}, visible={1}, mapped={2} showing={3}",
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Window visibility is: withdrawn={0}, visible={1}, mapped={2} showing={3}",
                   Boolean.valueOf(window.isWithdrawn()), Boolean.valueOf(window.isVisible()),
                   Boolean.valueOf(window.isMapped()), Boolean.valueOf(window.isShowing()));
+        }
         if (window.isShowing()) {
             requestState(window, state, set);
         } else {
             XAtomList net_wm_state = window.getNETWMState();
-            log.finer("Current state on {0} is {1}", window, net_wm_state);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Current state on {0} is {1}", window, net_wm_state);
+            }
             if (!set) {
                 net_wm_state.remove(state);
             } else {
                 net_wm_state.add(state);
             }
-            log.fine("Setting states on {0} to {1}", window, net_wm_state);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Setting states on {0} to {1}", window, net_wm_state);
+            }
             window.setNETWMState(net_wm_state);
         }
         XToolkit.XSync();
@@ -274,7 +290,9 @@
         }
         NetWindow = checkAnchor(XA_NET_SUPPORTING_WM_CHECK, XAtom.XA_WINDOW);
         supportChecked = true;
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " is active: " + (NetWindow != 0));
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### " + this + " is active: " + (NetWindow != 0));
+        }
     }
 
     boolean active() {
@@ -284,7 +302,9 @@
 
     boolean doStateProtocol() {
         boolean res = active() && checkProtocol(XA_NET_SUPPORTED, XA_NET_WM_STATE);
-        stateLog.finer("doStateProtocol() returns " + res);
+        if (stateLog.isLoggable(PlatformLogger.FINER)) {
+            stateLog.finer("doStateProtocol() returns " + res);
+        }
         return res;
     }
 
@@ -311,7 +331,9 @@
         if (net_wm_name_string == null) {
             return false;
         }
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### WM_NAME = " + net_wm_name_string);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### WM_NAME = " + net_wm_name_string);
+        }
         return net_wm_name_string.startsWith(name);
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -123,7 +123,9 @@
      * for adding separators
      */
     public void addSeparator() {
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer("addSeparator is not implemented");
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("addSeparator is not implemented");
+        }
     }
 
     /*
--- a/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java	Fri Apr 12 14:33:38 2013 +0400
@@ -54,7 +54,9 @@
         } finally {
             if (firstCheck) {
                 firstCheck = false;
-                log.fine("{0}:{1} supports {2}", this, listName, protocols);
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("{0}:{1} supports {2}", this, listName, protocols);
+                }
             }
         }
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java	Fri Apr 12 14:33:38 2013 +0400
@@ -118,7 +118,9 @@
     abstract protected void rebuildArrows();
 
     public void setSize(int width, int height) {
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer("Setting scroll bar " + this + " size to " + width + "x" + height);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Setting scroll bar " + this + " size to " + width + "x" + height);
+        }
         this.width = width;
         this.height = height;
     }
@@ -164,7 +166,9 @@
      * @param paintAll paint the whole scrollbar if true, just the thumb is false
      */
     void paint(Graphics g, Color colors[], boolean paintAll) {
-        if (log.isLoggable(PlatformLogger.FINER)) log.finer("Painting scrollbar " + this);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Painting scrollbar " + this);
+        }
 
         boolean useBufferedImage = false;
         Graphics2D g2 = null;
@@ -335,7 +339,9 @@
      * Tell the scroller to start scrolling.
      */
     void startScrolling() {
-        log.finer("Start scrolling on " + this);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Start scrolling on " + this);
+        }
         // Make sure that we scroll at least once
         scroll();
 
@@ -355,7 +361,9 @@
      * See 6243382 for more information
      */
     void startScrollingInstance() {
-        log.finer("Start scrolling on " + this);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Start scrolling on " + this);
+        }
         // Make sure that we scroll at least once
         scroll();
 
@@ -368,7 +376,9 @@
      * See 6243382 for more information
      */
     void stopScrollingInstance() {
-        log.finer("Stop scrolling on " + this);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("Stop scrolling on " + this);
+        }
 
         i_scroller.stop();
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -156,7 +156,9 @@
 
     public void handleJavaKeyEvent(KeyEvent event) {
         super.handleJavaKeyEvent(event);
-        if (log.isLoggable(PlatformLogger.FINEST)) log.finer("KeyEvent on scrollbar: " + event);
+        if (log.isLoggable(PlatformLogger.FINER)) {
+            log.finer("KeyEvent on scrollbar: " + event);
+        }
         if (!(event.isConsumed()) && event.getID() == KeyEvent.KEY_RELEASED) {
             switch(event.getKeyCode()) {
             case KeyEvent.VK_UP:
--- a/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -58,7 +58,9 @@
         long selection_owner = selection.getOwner(SCREEN);
         available = (selection_owner != XConstants.None);
 
-        log.fine(" check if system tray is available. selection owner: " + selection_owner);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine(" check if system tray is available. selection owner: " + selection_owner);
+        }
     }
 
     public void ownerChanged(int screen, XMSelection sel, long newOwner, long data, long timestamp) {
@@ -106,7 +108,9 @@
     void addTrayIcon(XTrayIconPeer tiPeer) throws AWTException {
         long selection_owner = selection.getOwner(SCREEN);
 
-        log.fine(" send SYSTEM_TRAY_REQUEST_DOCK message to owner: " + selection_owner);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine(" send SYSTEM_TRAY_REQUEST_DOCK message to owner: " + selection_owner);
+        }
 
         if (selection_owner == XConstants.None) {
             throw new AWTException("TrayIcon couldn't be displayed.");
--- a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -258,7 +258,9 @@
     }
 
     public void setBackground(Color c) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("target="+ target + ", old=" + background + ", new=" + c);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("target="+ target + ", old=" + background + ", new=" + c);
+        }
         background = c;
         if (xtext != null) {
             xtext.setBackground(c);
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Fri Apr 12 14:33:38 2013 +0400
@@ -1492,7 +1492,9 @@
                 }
             } catch (InterruptedException ie) {
             // Note: the returned timeStamp can be incorrect in this case.
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Catched exception, timeStamp may not be correct (ie = " + ie + ")");
+                }
             }
         } finally {
             awtUnlock();
@@ -1657,7 +1659,9 @@
 
             name = "gnome." + name;
             setDesktopProperty(name, e.getValue());
-            log.fine("name = " + name + " value = " + e.getValue());
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("name = " + name + " value = " + e.getValue());
+            }
 
             // XXX: we probably want to do something smarter.  In
             // particular, "Net" properties are of interest to the
@@ -2467,13 +2471,14 @@
             // Wait for selection notify for oops on win
             long event_number = getEventNumber();
             XAtom atom = XAtom.get("WM_S0");
-            eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
+            if (eventLog.isLoggable(PlatformLogger.FINER)) {
+                eventLog.finer("WM_S0 selection owner {0}", XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom()));
+            }
             XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
                                           XAtom.get("VERSION").getAtom(), oops.getAtom(),
                                           win.getWindow(), XConstants.CurrentTime);
             XSync();
 
-
             eventLog.finer("Requested OOPS");
 
             long start = System.currentTimeMillis();
--- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -106,9 +106,11 @@
 
                     XConfigureEvent ce = ev.get_xconfigure();
 
-                    ctrLog.fine("ConfigureNotify on parent of {0}: {1}x{2}+{3}+{4} (old: {5}+{6})",
+                    if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                        ctrLog.fine("ConfigureNotify on parent of {0}: {1}x{2}+{3}+{4} (old: {5}+{6})",
                                 XTrayIconPeer.this, ce.get_width(), ce.get_height(),
                                 ce.get_x(), ce.get_y(), old_x, old_y);
+                    }
 
                     // A workaround for Gnome/Metacity (it doesn't affect the behaviour on KDE).
                     // On Metacity the EmbeddedFrame's parent window bounds are larger
@@ -128,14 +130,18 @@
                         // If both the height and the width differ from the fixed size then WM
                         // must level at least one side to the fixed size. For some reason it may take
                         // a few hops (even after reparenting) and we have to skip the intermediate ones.
-                        ctrLog.fine("ConfigureNotify on parent of {0}. Skipping as intermediate resizing.",
+                        if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                            ctrLog.fine("ConfigureNotify on parent of {0}. Skipping as intermediate resizing.",
                                     XTrayIconPeer.this);
+                        }
                         return;
 
                     } else if (ce.get_height() > TRAY_ICON_HEIGHT) {
 
-                        ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"Y\".",
+                        if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                            ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"Y\".",
                                     XTrayIconPeer.this);
+                        }
 
                         XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), eframeParentID,
                                                       ce.get_x(),
@@ -147,8 +153,10 @@
 
                     } else if (ce.get_width() > TRAY_ICON_WIDTH) {
 
-                        ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"X\".",
+                        if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                            ctrLog.fine("ConfigureNotify on parent of {0}. Centering by \"X\".",
                                     XTrayIconPeer.this);
+                        }
 
                         XlibWrapper.XMoveResizeWindow(XToolkit.getDisplay(), eframeParentID,
                                                       ce.get_x()+ce.get_width()/2 - TRAY_ICON_WIDTH/2,
@@ -165,8 +173,10 @@
 
                         if (ex_height != 0) {
 
-                            ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"Y\".",
+                            if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                                ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"Y\".",
                                         XTrayIconPeer.this);
+                            }
 
                             XlibWrapper.XMoveWindow(XToolkit.getDisplay(), eframeParentID,
                                                     ce.get_x(),
@@ -174,15 +184,19 @@
 
                         } else if (ex_width != 0) {
 
-                            ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"X\".",
+                            if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                                ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Centering by \"X\".",
                                         XTrayIconPeer.this);
+                            }
 
                             XlibWrapper.XMoveWindow(XToolkit.getDisplay(), eframeParentID,
                                                     ce.get_x() + ex_width/2 - TRAY_ICON_WIDTH/2,
                                                     ce.get_y());
                         } else {
-                            ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Skipping.",
+                            if (ctrLog.isLoggable(PlatformLogger.FINE)) {
+                                ctrLog.fine("ConfigureNotify on parent of {0}. Move detected. Skipping.",
                                         XTrayIconPeer.this);
+                            }
                         }
                     }
                     old_x = ce.get_x();
--- a/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java	Fri Apr 12 14:33:38 2013 +0400
@@ -63,7 +63,9 @@
             req.set_format(32);
             req.set_data(0, (WIN_STATE_MAXIMIZED_HORIZ | WIN_STATE_MAXIMIZED_VERT));
             req.set_data(1, win_state);
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("Sending WIN_STATE to root to change the state to " + win_state);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Sending WIN_STATE to root to change the state to " + win_state);
+            }
             try {
                 XToolkit.awtLock();
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
@@ -111,7 +113,9 @@
                 win_state &= ~WIN_STATE_MAXIMIZED_HORIZ;
             }
             if ((old_win_state ^ win_state) != 0) {
-                if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting WIN_STATE on " + window + " to change the state to " + win_state);
+                if (log.isLoggable(PlatformLogger.FINE)) {
+                    log.fine("Setting WIN_STATE on " + window + " to change the state to " + win_state);
+                }
                 XA_WIN_STATE.setCard32Property(window, win_state);
             }
         }
@@ -156,7 +160,9 @@
             req.set_data(0, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
             req.set_data(1, 0);
             req.set_data(2, 0);
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting layer " + layer + " by root message : " + req);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Setting layer " + layer + " by root message : " + req);
+            }
             XToolkit.awtLock();
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
@@ -171,7 +177,9 @@
             }
             req.dispose();
         } else {
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting layer property to " + layer);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("Setting layer property to " + layer);
+            }
             XA_WIN_LAYER.setCard32Property(window, layer == LAYER_NORMAL ? WIN_LAYER_NORMAL : WIN_LAYER_ONTOP);
         }
     }
@@ -197,7 +205,9 @@
         }
         WinWindow = checkAnchor(XA_WIN_SUPPORTING_WM_CHECK, XAtom.XA_CARDINAL);
         supportChecked = true;
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " is active: " + (WinWindow != 0));
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### " + this + " is active: " + (WinWindow != 0));
+        }
     }
 
     boolean active() {
@@ -206,13 +216,17 @@
     }
     boolean doStateProtocol() {
         boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_STATE);
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " supports state: " + res);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### " + this + " supports state: " + res);
+        }
         return res;
     }
 
     boolean doLayerProtocol() {
         boolean res = active() && checkProtocol(XA_WIN_PROTOCOLS, XA_WIN_LAYER);
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("### " + this + " supports layer: " + res);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("### " + this + " supports layer: " + res);
+        }
         return res;
     }
 }
--- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Fri Apr 12 14:33:38 2013 +0400
@@ -148,7 +148,9 @@
     XWM(int WMID) {
         this.WMID = WMID;
         initializeProtocols();
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Window manager: " + toString());
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Window manager: " + toString());
+        }
     }
     int getID() {
         return WMID;
@@ -252,7 +254,7 @@
              * having a window manager running. I.e. it does not reparent
              * top level shells.
              */
-            if (insLog.isLoggable(PlatformLogger.FINE)) {
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
                 insLog.finer("eXcursion means NO_WM");
             }
             return true;
@@ -270,7 +272,7 @@
             long selection_owner =
                 XlibWrapper.XGetSelectionOwner(XToolkit.getDisplay(),
                                                XAtom.get(selection_name).getAtom());
-            if (insLog.isLoggable(PlatformLogger.FINE)) {
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
                 insLog.finer("selection owner of " + selection_name
                              + " is " + selection_owner);
             }
@@ -299,7 +301,7 @@
                                                     XToolkit.getDefaultRootWindow(),
                                                     XConstants.CWEventMask,
                                                     substruct.pData);
-                if (insLog.isLoggable(PlatformLogger.FINE)) {
+                if (insLog.isLoggable(PlatformLogger.FINER)) {
                     insLog.finer("It looks like there is no WM thus NO_WM");
                 }
             }
@@ -343,18 +345,26 @@
             byte[] bytes = XlibWrapper.getStringBytes(getter.getData());
             String id = new String(bytes);
 
-            log.finer("ENLIGHTENMENT_COMMS is " + id);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("ENLIGHTENMENT_COMMS is " + id);
+            }
 
             // Parse WINID
             Pattern winIdPat = Pattern.compile("WINID\\s+(\\p{XDigit}{0,8})");
             try {
                 Matcher match = winIdPat.matcher(id);
                 if (match.matches()) {
-                    log.finest("Match group count: " + match.groupCount());
+                    if (log.isLoggable(PlatformLogger.FINEST)) {
+                        log.finest("Match group count: " + match.groupCount());
+                    }
                     String longId = match.group(1);
-                    log.finest("Match group 1 " + longId);
+                    if (log.isLoggable(PlatformLogger.FINEST)) {
+                        log.finest("Match group 1 " + longId);
+                    }
                     long winid = Long.parseLong(longId, 16);
-                    log.finer("Enlightenment communication window " + winid);
+                    if (log.isLoggable(PlatformLogger.FINER)) {
+                        log.finer("Enlightenment communication window " + winid);
+                    }
                     return winid;
                 } else {
                     log.finer("ENLIGHTENMENT_COMMS has wrong format");
@@ -407,7 +417,9 @@
     static boolean isCDE() {
 
         if (!XA_DT_SM_WINDOW_INFO.isInterned()) {
-            log.finer("{0} is not interned", XA_DT_SM_WINDOW_INFO);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("{0} is not interned", XA_DT_SM_WINDOW_INFO);
+            }
             return false;
         }
 
@@ -438,7 +450,9 @@
 
             /* Now check that this window has _DT_SM_STATE_INFO (ignore contents) */
             if (!XA_DT_SM_STATE_INFO.isInterned()) {
-                log.finer("{0} is not interned", XA_DT_SM_STATE_INFO);
+                if (log.isLoggable(PlatformLogger.FINER)) {
+                    log.finer("{0} is not interned", XA_DT_SM_STATE_INFO);
+                }
                 return false;
             }
             WindowPropertyGetter getter2 =
@@ -610,7 +624,9 @@
          */
 
         if (!XA_ICEWM_WINOPTHINT.isInterned()) {
-            log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
+            }
             return false;
         }
 
@@ -643,7 +659,9 @@
      */
     static boolean isIceWM() {
         if (!XA_ICEWM_WINOPTHINT.isInterned()) {
-            log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("{0} is not interned", XA_ICEWM_WINOPTHINT);
+            }
             return false;
         }
 
@@ -654,7 +672,9 @@
         try {
             int status = getter.execute();
             boolean res = (status == XConstants.Success && getter.getActualType() != 0);
-            log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
+            }
             return !res || isNetWMName("IceWM");
         } finally {
             getter.dispose();
@@ -816,7 +836,9 @@
             }
 
             hints.set_flags(hints.get_flags() & ~mask);
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Setting hints, flags " + XlibWrapper.hintsToString(hints.get_flags()));
+            }
             XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(),
                                           window.getWindow(),
                                           hints.pData);
@@ -873,7 +895,9 @@
 
         XAtomList decorDel = new XAtomList();
         decorations = normalizeMotifDecor(decorations);
-        if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
+        }
         if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
             decorDel.add(XA_OL_DECOR_HEADER);
         }
@@ -890,7 +914,9 @@
             insLog.finer("Deleting OL_DECOR");
             XA_OL_DECOR_DEL.DeleteProperty(window);
         } else {
-            if (insLog.isLoggable(PlatformLogger.FINER)) insLog.finer("Setting OL_DECOR to " + decorDel);
+            if (insLog.isLoggable(PlatformLogger.FINER)) {
+                insLog.finer("Setting OL_DECOR to " + decorDel);
+            }
             XA_OL_DECOR_DEL.setAtomListProperty(window, decorDel);
         }
     }
@@ -918,7 +944,9 @@
         hints.set_functions(functions);
         hints.set_decorations(decorations);
 
-        if (stateLog.isLoggable(PlatformLogger.FINER)) stateLog.finer("Setting MWM_HINTS to " + hints);
+        if (stateLog.isLoggable(PlatformLogger.FINER)) {
+            stateLog.finer("Setting MWM_HINTS to " + hints);
+        }
         window.setMWMHints(hints);
     }
 
@@ -980,7 +1008,9 @@
      * Make specified shell resizable.
      */
     static void setShellResizable(XDecoratedPeer window) {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting shell resizable " + window);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting shell resizable " + window);
+        }
         XToolkit.awtLock();
         try {
             Rectangle shellBounds = window.getShellBounds();
@@ -1010,8 +1040,10 @@
     static void setShellNotResizable(XDecoratedPeer window, WindowDimensions newDimensions, Rectangle shellBounds,
                                      boolean justChangeSize)
     {
-        if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
-                                                       ", shellBounds " + shellBounds +", just change size: " + justChangeSize);
+        if (insLog.isLoggable(PlatformLogger.FINE)) {
+            insLog.fine("Setting non-resizable shell " + window + ", dimensions " + newDimensions +
+                        ", shellBounds " + shellBounds +", just change size: " + justChangeSize);
+        }
         XToolkit.awtLock();
         try {
             /* Fix min/max size hints at the specified values */
@@ -1142,7 +1174,9 @@
             stateLog.finer("WithdrawnState");
             return false;
         } else {
-            stateLog.finer("Window WM_STATE is " + wm_state);
+            if (stateLog.isLoggable(PlatformLogger.FINER)) {
+                stateLog.finer("Window WM_STATE is " + wm_state);
+            }
         }
         boolean is_state_change = false;
         if (e.get_atom() == XA_WM_STATE.getAtom()) {
@@ -1151,7 +1185,9 @@
 
         for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
             is_state_change |= proto.isStateChange(e);
-            stateLog.finest(proto + ": is state changed = " + is_state_change);
+            if (stateLog.isLoggable(PlatformLogger.FINEST)) {
+                stateLog.finest(proto + ": is state changed = " + is_state_change);
+            }
         }
         return is_state_change;
     }
@@ -1303,7 +1339,9 @@
                   res = defaultInsets;
             }
         }
-        if (insLog.isLoggable(PlatformLogger.FINEST)) insLog.finest("WM guessed insets: " + res);
+        if (insLog.isLoggable(PlatformLogger.FINEST)) {
+            insLog.finest("WM guessed insets: " + res);
+        }
         return res;
     }
     /*
@@ -1372,7 +1410,9 @@
         XNETProtocol net_protocol = getWM().getNETProtocol();
         if (net_protocol != null && net_protocol.active()) {
             Insets insets = getInsetsFromProp(window, XA_NET_FRAME_EXTENTS);
-            insLog.fine("_NET_FRAME_EXTENTS: {0}", insets);
+            if (insLog.isLoggable(PlatformLogger.FINE)) {
+                insLog.fine("_NET_FRAME_EXTENTS: {0}", insets);
+            }
 
             if (insets != null) {
                 return insets;
@@ -1513,7 +1553,9 @@
          *       [mwm, e!, kwin, fvwm2 ... ]
          */
         Insets correctWM = XWM.getInsetsFromExtents(window);
-        insLog.finer("Got insets from property: {0}", correctWM);
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Got insets from property: {0}", correctWM);
+        }
 
         if (correctWM == null) {
             correctWM = new Insets(0,0,0,0);
@@ -1574,7 +1616,9 @@
                   }
                   case XWM.OTHER_WM:
                   default: {                /* this is very similar to the E! case above */
-                      insLog.finest("Getting correct insets for OTHER_WM/default, parent: {0}", parent);
+                      if (insLog.isLoggable(PlatformLogger.FINEST)) {
+                          insLog.finest("Getting correct insets for OTHER_WM/default, parent: {0}", parent);
+                      }
                       syncTopLevelPos(parent, lwinAttr);
                       int status = XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(),
                                                                     window, lwinAttr.pData);
@@ -1601,8 +1645,10 @@
                           && lwinAttr.get_width()+2*lwinAttr.get_border_width() == pattr.get_width()
                           && lwinAttr.get_height()+2*lwinAttr.get_border_width() == pattr.get_height())
                       {
-                          insLog.finest("Double reparenting detected, pattr({2})={0}, lwinAttr({3})={1}",
+                          if (insLog.isLoggable(PlatformLogger.FINEST)) {
+                              insLog.finest("Double reparenting detected, pattr({2})={0}, lwinAttr({3})={1}",
                                         lwinAttr, pattr, parent, window);
+                          }
                           lwinAttr.set_x(pattr.get_x());
                           lwinAttr.set_y(pattr.get_y());
                           lwinAttr.set_border_width(lwinAttr.get_border_width()+pattr.get_border_width());
@@ -1629,8 +1675,10 @@
                        * widths and inner/outer distinction, so for the time
                        * being, just ignore it.
                        */
-                      insLog.finest("Attrs before calculation: pattr({2})={0}, lwinAttr({3})={1}",
+                      if (insLog.isLoggable(PlatformLogger.FINEST)) {
+                          insLog.finest("Attrs before calculation: pattr({2})={0}, lwinAttr({3})={1}",
                                     lwinAttr, pattr, parent, window);
+                      }
                       correctWM = new Insets(lwinAttr.get_y() + lwinAttr.get_border_width(),
                                              lwinAttr.get_x() + lwinAttr.get_border_width(),
                                              pattr.get_height() - (lwinAttr.get_y() + lwinAttr.get_height() + 2*lwinAttr.get_border_width()),
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Fri Apr 12 14:33:38 2013 +0400
@@ -402,7 +402,9 @@
                     ((Component)e.getSource()).dispatchEvent(e);
                 }
             }, PeerEvent.ULTIMATE_PRIORITY_EVENT);
-        if (focusLog.isLoggable(PlatformLogger.FINER) && (e instanceof FocusEvent)) focusLog.finer("Sending " + e);
+        if (focusLog.isLoggable(PlatformLogger.FINER) && (e instanceof FocusEvent)) {
+            focusLog.finer("Sending " + e);
+        }
         XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), pe);
     }
 
@@ -660,7 +662,9 @@
         if (isEventDisabled(xev)) {
             return;
         }
-        if (eventLog.isLoggable(PlatformLogger.FINE)) eventLog.fine(xbe.toString());
+        if (eventLog.isLoggable(PlatformLogger.FINE)) {
+            eventLog.fine(xbe.toString());
+        }
         long when;
         int modifiers;
         boolean popupTrigger = false;
@@ -694,9 +698,11 @@
             /*
                multiclick checking
             */
-            if (eventLog.isLoggable(PlatformLogger.FINEST)) eventLog.finest("lastWindow = " + lastWindow + ", lastButton "
-                                                                   + lastButton + ", lastTime " + lastTime + ", multiClickTime "
-                                                                   + XToolkit.getMultiClickTime());
+            if (eventLog.isLoggable(PlatformLogger.FINEST)) {
+                eventLog.finest("lastWindow = " + lastWindow + ", lastButton "
+                + lastButton + ", lastTime " + lastTime + ", multiClickTime "
+                + XToolkit.getMultiClickTime());
+            }
             if (lastWindow == this && lastButton == lbutton && (when - lastTime) < XToolkit.getMultiClickTime()) {
                 clickCount++;
             } else {
@@ -885,7 +891,9 @@
         super.handleXCrossingEvent(xev);
         XCrossingEvent xce = xev.get_xcrossing();
 
-        if (eventLog.isLoggable(PlatformLogger.FINEST)) eventLog.finest(xce.toString());
+        if (eventLog.isLoggable(PlatformLogger.FINEST)) {
+            eventLog.finest(xce.toString());
+        }
 
         if (xce.get_type() == XConstants.EnterNotify) {
             enterNotify(xce.get_window());
@@ -987,8 +995,10 @@
         Rectangle oldBounds = getBounds();
 
         super.handleConfigureNotifyEvent(xev);
-        insLog.finer("Configure, {0}, event disabled: {1}",
+        if (insLog.isLoggable(PlatformLogger.FINER)) {
+            insLog.finer("Configure, {0}, event disabled: {1}",
                      xev.get_xconfigure(), isEventDisabled(xev));
+        }
         if (isEventDisabled(xev)) {
             return;
         }
@@ -1007,7 +1017,9 @@
 
     public void handleMapNotifyEvent(XEvent xev) {
         super.handleMapNotifyEvent(xev);
-        log.fine("Mapped {0}", this);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Mapped {0}", this);
+        }
         if (isEventDisabled(xev)) {
             return;
         }
@@ -1029,10 +1041,12 @@
     }
 
     private void dumpKeysymArray(XKeyEvent ev) {
-        keyEventLog.fine("  "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 0))+
-                         "\n        "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 1))+
-                         "\n        "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 2))+
-                         "\n        "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 3)));
+        if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
+            keyEventLog.fine("  "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 0))+
+                             "\n        "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 1))+
+                             "\n        "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 2))+
+                             "\n        "+Long.toHexString(XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(), ev.get_keycode(), 3)));
+        }
     }
     /**
        Return unicode character or 0 if no correspondent character found.
@@ -1057,14 +1071,20 @@
         //return (uni > 0? uni + 0x01000000 : 0);
     }
     void logIncomingKeyEvent(XKeyEvent ev) {
-        keyEventLog.fine("--XWindow.java:handleKeyEvent:"+ev);
+        if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
+            keyEventLog.fine("--XWindow.java:handleKeyEvent:"+ev);
+        }
         dumpKeysymArray(ev);
-        keyEventLog.fine("XXXXXXXXXXXXXX javakeycode will be most probably:0x"+ Integer.toHexString(XKeysym.getJavaKeycodeOnly(ev)));
+        if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
+            keyEventLog.fine("XXXXXXXXXXXXXX javakeycode will be most probably:0x"+ Integer.toHexString(XKeysym.getJavaKeycodeOnly(ev)));
+        }
     }
     public void handleKeyPress(XEvent xev) {
         super.handleKeyPress(xev);
         XKeyEvent ev = xev.get_xkey();
-        if (eventLog.isLoggable(PlatformLogger.FINE)) eventLog.fine(ev.toString());
+        if (eventLog.isLoggable(PlatformLogger.FINE)) {
+            eventLog.fine(ev.toString());
+        }
         if (isEventDisabled(xev)) {
             return;
         }
@@ -1153,7 +1173,9 @@
 
 
         if (unicodeKey > 0 && !isDeadKey) {
-                keyEventLog.fine("fire _TYPED on "+unicodeKey);
+                if (keyEventLog.isLoggable(PlatformLogger.FINE)) {
+                    keyEventLog.fine("fire _TYPED on "+unicodeKey);
+                }
                 postKeyEvent( java.awt.event.KeyEvent.KEY_TYPED,
                               ev.get_time(),
                               java.awt.event.KeyEvent.VK_UNDEFINED,
@@ -1171,7 +1193,9 @@
     public void handleKeyRelease(XEvent xev) {
         super.handleKeyRelease(xev);
         XKeyEvent ev = xev.get_xkey();
-        if (eventLog.isLoggable(PlatformLogger.FINE)) eventLog.fine(ev.toString());
+        if (eventLog.isLoggable(PlatformLogger.FINE)) {
+            eventLog.fine(ev.toString());
+        }
         if (isEventDisabled(xev)) {
             return;
         }
@@ -1333,10 +1357,14 @@
     void updateSizeHints(int x, int y, int width, int height) {
         long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition));
         if (!isResizable()) {
-            log.finer("Window {0} is not resizable", this);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Window {0} is not resizable", this);
+            }
             flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize;
         } else {
-            log.finer("Window {0} is resizable", this);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Window {0} is resizable", this);
+            }
         }
         setSizeHints(flags, x, y, width, height);
     }
@@ -1344,10 +1372,14 @@
     void updateSizeHints(int x, int y) {
         long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition);
         if (!isResizable()) {
-            log.finer("Window {0} is not resizable", this);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Window {0} is not resizable", this);
+            }
             flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize;
         } else {
-            log.finer("Window {0} is resizable", this);
+            if (log.isLoggable(PlatformLogger.FINER)) {
+                log.finer("Window {0} is resizable", this);
+            }
         }
         setSizeHints(flags, x, y, width, height);
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -227,10 +227,10 @@
         if (owner != null) {
             ownerPeer = (XWindowPeer)owner.getPeer();
             if (focusLog.isLoggable(PlatformLogger.FINER)) {
-                focusLog.fine("Owner is " + owner);
-                focusLog.fine("Owner peer is " + ownerPeer);
-                focusLog.fine("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
-                focusLog.fine("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
+                focusLog.finer("Owner is " + owner);
+                focusLog.finer("Owner peer is " + ownerPeer);
+                focusLog.finer("Owner X window " + Long.toHexString(ownerPeer.getWindow()));
+                focusLog.finer("Owner content X window " + Long.toHexString(ownerPeer.getContentWindow()));
             }
             // as owner window may be an embedded window, we must get a toplevel window
             // to set as TRANSIENT_FOR hint
@@ -239,8 +239,10 @@
                 XToolkit.awtLock();
                 try {
                     // Set WM_TRANSIENT_FOR
-                    if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
-                                                                       + " for " + Long.toHexString(ownerWindow));
+                    if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                        focusLog.fine("Setting transient on " + Long.toHexString(getWindow())
+                                      + " for " + Long.toHexString(ownerWindow));
+                    }
                     setToplevelTransientFor(this, ownerPeer, false, true);
 
                     // Set group leader
@@ -777,7 +779,9 @@
         // override_redirect all we can do is check whether our parent
         // is active. If it is - we can freely synthesize focus transfer.
         // Luckily, this logic is already implemented in requestWindowFocus.
-        if (focusLog.isLoggable(PlatformLogger.FINE)) focusLog.fine("Requesting window focus");
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+            focusLog.fine("Requesting window focus");
+        }
         requestWindowFocus(time, timeProvided);
     }
 
@@ -803,7 +807,9 @@
     public void handleFocusEvent(XEvent xev) {
         XFocusChangeEvent xfe = xev.get_xfocus();
         FocusEvent fe;
-        focusLog.fine("{0}", xfe);
+        if (focusLog.isLoggable(PlatformLogger.FINE)) {
+            focusLog.fine("{0}", xfe);
+        }
         if (isEventDisabled(xev)) {
             return;
         }
@@ -986,7 +992,9 @@
     }
 
     private void updateAlwaysOnTop() {
-        log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop));
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Promoting always-on-top state {0}", Boolean.valueOf(alwaysOnTop));
+        }
         XWM.getWM().setLayer(this,
                              alwaysOnTop ?
                              XLayerProtocol.LAYER_ALWAYS_ON_TOP :
@@ -1511,7 +1519,9 @@
             synchronized(getStateLock()) {
                 XDialogPeer blockerPeer = (XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(d);
                 if (blocked) {
-                    log.fine("{0} is blocked by {1}", this, blockerPeer);
+                    if (log.isLoggable(PlatformLogger.FINE)) {
+                        log.fine("{0} is blocked by {1}", this, blockerPeer);
+                    }
                     modalBlocker = d;
 
                     if (isReparented() || XWM.isNonReparentingWM()) {
@@ -1900,7 +1910,9 @@
 
     @Override
     public void xSetVisible(boolean visible) {
-        if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting visible on " + this + " to " + visible);
+        if (log.isLoggable(PlatformLogger.FINE)) {
+            log.fine("Setting visible on " + this + " to " + visible);
+        }
         XToolkit.awtLock();
         try {
             this.visible = visible;
@@ -2053,7 +2065,9 @@
             // since it generates MOUSE_ENTERED/MOUSE_EXITED for frame and dialog.
             // (fix for 6390326)
             XBaseWindow target = XToolkit.windowToXWindow(xce.get_window());
-            grabLog.finer("  -  Grab event target {0}", target);
+            if (grabLog.isLoggable(PlatformLogger.FINER)) {
+                grabLog.finer("  -  Grab event target {0}", target);
+            }
             if (target != null && target != this) {
                 target.dispatchEvent(xev);
                 return;
@@ -2064,7 +2078,7 @@
 
     public void handleMotionNotify(XEvent xev) {
         XMotionEvent xme = xev.get_xmotion();
-        if (grabLog.isLoggable(PlatformLogger.FINE)) {
+        if (grabLog.isLoggable(PlatformLogger.FINER)) {
             grabLog.finer("{0}, when grabbed {1}, contains {2}",
                           xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root()));
         }
@@ -2095,7 +2109,9 @@
                 xme.set_x(localCoord.x);
                 xme.set_y(localCoord.y);
             }
-            grabLog.finer("  -  Grab event target {0}", target);
+            if (grabLog.isLoggable(PlatformLogger.FINER)) {
+                grabLog.finer("  -  Grab event target {0}", target);
+            }
             if (target != null) {
                 if (target != getContentXWindow() && target != this) {
                     target.dispatchEvent(xev);
@@ -2138,7 +2154,9 @@
             // translation)
             XBaseWindow target = XToolkit.windowToXWindow(xbe.get_window());
             try {
-                grabLog.finer("  -  Grab event target {0} (press target {1})", target, pressTarget);
+                if (grabLog.isLoggable(PlatformLogger.FINER)) {
+                    grabLog.finer("  -  Grab event target {0} (press target {1})", target, pressTarget);
+                }
                 if (xbe.get_type() == XConstants.ButtonPress
                     && xbe.get_button() == XConstants.buttons[0])
                 {
@@ -2172,7 +2190,9 @@
                         // According to the specification of UngrabEvent, post it
                         // when press occurs outside of the window and not on its owned windows
                         if (xbe.get_type() == XConstants.ButtonPress) {
-                            grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this);
+                            if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                                grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this);
+                            }
                             postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
                             return;
                         }
@@ -2191,18 +2211,24 @@
                             // toplevel == null - outside of
                             // hierarchy, toplevel is Dialog - should
                             // send ungrab (but shouldn't for Window)
-                            grabLog.fine("Generating UngrabEvent on {0} because hierarchy ended", this);
+                            if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                                grabLog.fine("Generating UngrabEvent on {0} because hierarchy ended", this);
+                            }
                             postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
                         }
                     } else {
                         // toplevel is null - outside of hierarchy
-                        grabLog.fine("Generating UngrabEvent on {0} because toplevel is null", this);
+                        if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                            grabLog.fine("Generating UngrabEvent on {0} because toplevel is null", this);
+                        }
                         postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
                         return;
                     }
                 } else {
                     // target doesn't map to XAWT window - outside of hierarchy
-                    grabLog.fine("Generating UngrabEvent on because target is null {0}", this);
+                    if (grabLog.isLoggable(PlatformLogger.FINE)) {
+                        grabLog.fine("Generating UngrabEvent on because target is null {0}", this);
+                    }
                     postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
                     return;
                 }
--- a/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java	Fri Apr 12 14:33:38 2013 +0400
@@ -806,11 +806,15 @@
             }
         }
         if (s_size_32 != null && !s_size_32.equals(Integer.toString(acc_size_32))) {
-            log.fine("32 bits: The size of the structure " + stp.getName() + " " + s_size_32 +
+            if (log.isLoggable(Level.FINE)) {
+                log.fine("32 bits: The size of the structure " + stp.getName() + " " + s_size_32 +
                         " is not equal to the accumulated size " +acc_size_32 + " of the fields");
+            }
         } else if (s_size_64 != null && !s_size_64.equals(Integer.toString(acc_size_64))) {
-            log.fine("64 bits: The size of the structure " + stp.getName() + " " +s_size_64+
+            if (log.isLoggable(Level.FINE)) {
+                log.fine("64 bits: The size of the structure " + stp.getName() + " " +s_size_64+
                         " is not equal to the accumulated size " +acc_size_64+" of the fields");
+            }
         }
     }
 
--- a/jdk/src/solaris/classes/sun/awt/X11InputMethod.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/solaris/classes/sun/awt/X11InputMethod.java	Fri Apr 12 14:33:38 2013 +0400
@@ -326,8 +326,10 @@
             return;
 
         if (lastXICFocussedComponent != null){
-            if (log.isLoggable(PlatformLogger.FINE)) log.fine("XICFocused {0}, AWTFocused {1}",
-                                                              lastXICFocussedComponent, awtFocussedComponent);
+            if (log.isLoggable(PlatformLogger.FINE)) {
+                log.fine("XICFocused {0}, AWTFocused {1}",
+                         lastXICFocussedComponent, awtFocussedComponent);
+            }
         }
 
         if (pData == 0) {
--- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java	Fri Apr 12 14:09:03 2013 +0400
+++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java	Fri Apr 12 14:33:38 2013 +0400
@@ -360,7 +360,9 @@
     }
 
     void handleJavaFocusEvent(FocusEvent fe) {
-        if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(fe.toString());
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer(fe.toString());
+        }
         setFocus(fe.getID() == FocusEvent.FOCUS_GAINED);
     }
 
@@ -693,7 +695,9 @@
               }
               boolean res = wpeer.requestWindowFocus(cause);
 
-              if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer("Requested window focus: " + res);
+              if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                  focusLog.finer("Requested window focus: " + res);
+              }
               // If parent window can be made focused and has been made focused(synchronously)
               // then we can proceed with children, otherwise we retreat.
               if (!(res && parentWindow.isFocused())) {
@@ -713,7 +717,9 @@
     }
 
     private boolean rejectFocusRequestHelper(String logMsg) {
-        if (focusLog.isLoggable(PlatformLogger.FINER)) focusLog.finer(logMsg);
+        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+            focusLog.finer(logMsg);
+        }
         WKeyboardFocusManagerPeer.removeLastFocusRequest((Component)target);
         return false;
     }
@@ -1080,10 +1086,9 @@
     @SuppressWarnings("deprecation")
     public void applyShape(Region shape) {
         if (shapeLog.isLoggable(PlatformLogger.FINER)) {
-            shapeLog.finer(
-                    "*** INFO: Setting shape: PEER: " + this
-                    + "; TARGET: " + target
-                    + "; SHAPE: " + shape);
+            shapeLog.finer("*** INFO: Setting shape: PEER: " + this
+                            + "; TARGET: " + target
+                            + "; SHAPE: " + shape);
         }
 
         if (shape != null) {