--- old/src/macosx/classes/sun/lwawt/LWWindowPeer.java 2013-03-20 14:41:07.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/LWWindowPeer.java 2013-03-20 14:41:06.000000000 +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(); } --- old/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java 2013-03-20 14:41:08.000000000 +0400 +++ new/src/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java 2013-03-20 14:41:08.000000000 +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 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 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 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 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); --- old/src/share/classes/java/awt/DefaultKeyboardFocusManager.java 2013-03-20 14:41:09.000000000 +0400 +++ new/src/share/classes/java/awt/DefaultKeyboardFocusManager.java 2013-03-20 14:41:09.000000000 +0400 @@ -310,7 +310,9 @@ * false 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)) { --- old/src/share/classes/java/awt/EventDispatchThread.java 2013-03-20 14:41:10.000000000 +0400 +++ new/src/share/classes/java/awt/EventDispatchThread.java 2013-03-20 14:41:10.000000000 +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); } --- old/src/share/classes/java/awt/KeyboardFocusManager.java 2013-03-20 14:41:11.000000000 +0400 +++ new/src/share/classes/java/awt/KeyboardFocusManager.java 2013-03-20 14:41:11.000000000 +0400 @@ -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; } } --- old/src/share/classes/java/awt/WaitDispatchSupport.java 2013-03-20 14:41:12.000000000 +0400 +++ new/src/share/classes/java/awt/WaitDispatchSupport.java 2013-03-20 14:41:12.000000000 +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)); } --- old/src/share/classes/javax/swing/BufferStrategyPaintManager.java 2013-03-20 14:41:14.000000000 +0400 +++ new/src/share/classes/javax/swing/BufferStrategyPaintManager.java 2013-03-20 14:41:13.000000000 +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"); } } } --- old/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java 2013-03-20 14:41:15.000000000 +0400 +++ new/src/share/classes/javax/swing/SortingFocusTraversalPolicy.java 2013-03-20 14:41:14.000000000 +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 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 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 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 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); --- old/src/share/classes/sun/awt/AWTAutoShutdown.java 2013-03-20 14:41:16.000000000 +0400 +++ new/src/share/classes/sun/awt/AWTAutoShutdown.java 2013-03-20 14:41:15.000000000 +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)); + } } } } --- old/src/share/classes/sun/awt/DebugSettings.java 2013-03-20 14:41:17.000000000 +0400 +++ new/src/share/classes/sun/awt/DebugSettings.java 2013-03-20 14:41:16.000000000 +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); } } --- old/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java 2013-03-20 14:41:18.000000000 +0400 +++ new/src/share/classes/sun/awt/KeyboardFocusManagerPeerImpl.java 2013-03-20 14:41:17.000000000 +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; } --- old/src/share/classes/sun/awt/SunToolkit.java 2013-03-20 14:41:19.000000000 +0400 +++ new/src/share/classes/sun/awt/SunToolkit.java 2013-03-20 14:41:19.000000000 +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); --- old/src/share/classes/sun/awt/im/InputContext.java 2013-03-20 14:41:20.000000000 +0400 +++ new/src/share/classes/sun/awt/im/InputContext.java 2013-03-20 14:41:20.000000000 +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); } --- old/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2013-03-20 14:41:21.000000000 +0400 +++ new/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java 2013-03-20 14:41:21.000000000 +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"); --- old/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java 2013-03-20 14:41:22.000000000 +0400 +++ new/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java 2013-03-20 14:41:22.000000000 +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); + } } } --- old/src/share/classes/sun/net/www/protocol/http/Negotiator.java 2013-03-20 14:41:24.000000000 +0400 +++ new/src/share/classes/sun/net/www/protocol/http/Negotiator.java 2013-03-20 14:41:23.000000000 +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); + } } } --- old/src/solaris/classes/sun/awt/X11/XAWTXSettings.java 2013-03-20 14:41:25.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XAWTXSettings.java 2013-03-20 14:41:24.000000000 +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); --- old/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java 2013-03-20 14:41:26.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java 2013-03-20 14:41:25.000000000 +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; } --- old/src/solaris/classes/sun/awt/X11/XBaseWindow.java 2013-03-20 14:41:27.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XBaseWindow.java 2013-03-20 14:41:27.000000000 +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(); @@ -1072,7 +1086,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()) { --- old/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2013-03-20 14:41:28.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XComponentPeer.java 2013-03-20 14:41:28.000000000 +0400 @@ -297,8 +297,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 +324,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 +346,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 +639,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 +650,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 +671,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); } --- old/src/solaris/classes/sun/awt/X11/XContentWindow.java 2013-03-20 14:41:29.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XContentWindow.java 2013-03-20 14:41:29.000000000 +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 --- old/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java 2013-03-20 14:41:30.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java 2013-03-20 14:41:30.000000000 +0400 @@ -179,7 +179,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 +229,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(); } @@ -296,7 +300,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 { @@ -382,7 +388,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; @@ -735,7 +743,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; } @@ -788,8 +798,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 +812,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 +825,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); @@ -1017,9 +1030,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 { @@ -1136,16 +1153,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); --- old/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2013-03-20 14:41:32.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java 2013-03-20 14:41:31.000000000 +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); } --- old/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java 2013-03-20 14:41:33.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java 2013-03-20 14:41:32.000000000 +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; --- old/src/solaris/classes/sun/awt/X11/XEmbedHelper.java 2013-03-20 14:41:34.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XEmbedHelper.java 2013-03-20 14:41:33.000000000 +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 { --- old/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2013-03-20 14:41:35.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java 2013-03-20 14:41:34.000000000 +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(); } } --- old/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java 2013-03-20 14:41:36.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java 2013-03-20 14:41:36.000000000 +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 = "./"; --- old/src/solaris/classes/sun/awt/X11/XFramePeer.java 2013-03-20 14:41:37.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XFramePeer.java 2013-03-20 14:41:37.000000000 +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(); @@ -257,11 +261,15 @@ 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 +279,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); } } @@ -297,7 +307,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 +361,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 { --- old/src/solaris/classes/sun/awt/X11/XIconWindow.java 2013-03-20 14:41:38.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XIconWindow.java 2013-03-20 14:41:38.000000000 +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(), @@ -92,7 +94,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); --- old/src/solaris/classes/sun/awt/X11/XInputMethod.java 2013-03-20 14:41:39.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XInputMethod.java 2013-03-20 14:41:39.000000000 +0400 @@ -102,7 +102,9 @@ 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); --- old/src/solaris/classes/sun/awt/X11/XListPeer.java 2013-03-20 14:41:41.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XListPeer.java 2013-03-20 14:41:40.000000000 +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,22 @@ 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"); + 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 +1934,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 +1974,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; --- old/src/solaris/classes/sun/awt/X11/XMSelection.java 2013-03-20 14:41:42.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XMSelection.java 2013-03-20 14:41:41.000000000 +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); --- old/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java 2013-03-20 14:41:43.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XMenuBarPeer.java 2013-03-20 14:41:42.000000000 +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; } --- old/src/solaris/classes/sun/awt/X11/XMenuPeer.java 2013-03-20 14:41:44.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XMenuPeer.java 2013-03-20 14:41:44.000000000 +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) { --- old/src/solaris/classes/sun/awt/X11/XNETProtocol.java 2013-03-20 14:41:45.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XNETProtocol.java 2013-03-20 14:41:45.000000000 +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 { @@ -97,7 +99,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()); @@ -274,7 +278,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 +290,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 +319,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); } --- old/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java 2013-03-20 14:41:46.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XPopupMenuPeer.java 2013-03-20 14:41:46.000000000 +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"); + } } /* --- old/src/solaris/classes/sun/awt/X11/XScrollbar.java 2013-03-20 14:41:47.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XScrollbar.java 2013-03-20 14:41:47.000000000 +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(); } --- old/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java 2013-03-20 14:41:48.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XScrollbarPeer.java 2013-03-20 14:41:48.000000000 +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.FINEST)) { + log.finer("KeyEvent on scrollbar: " + event); + } if (!(event.isConsumed()) && event.getID() == KeyEvent.KEY_RELEASED) { switch(event.getKeyCode()) { case KeyEvent.VK_UP: --- old/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java 2013-03-20 14:41:50.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java 2013-03-20 14:41:49.000000000 +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."); --- old/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java 2013-03-20 14:41:51.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java 2013-03-20 14:41:50.000000000 +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); --- old/src/solaris/classes/sun/awt/X11/XToolkit.java 2013-03-20 14:41:52.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XToolkit.java 2013-03-20 14:41:51.000000000 +0400 @@ -1490,7 +1490,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(); @@ -1655,7 +1657,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 @@ -2471,7 +2475,6 @@ win.getWindow(), XConstants.CurrentTime); XSync(); - eventLog.finer("Requested OOPS"); long start = System.currentTimeMillis(); --- old/src/solaris/classes/sun/awt/X11/XWINProtocol.java 2013-03-20 14:41:53.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XWINProtocol.java 2013-03-20 14:41:53.000000000 +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; } } --- old/src/solaris/classes/sun/awt/X11/XWM.java 2013-03-20 14:41:54.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XWM.java 2013-03-20 14:41:54.000000000 +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"); @@ -654,7 +664,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 +828,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 +887,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 +906,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 +936,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 +1000,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 +1032,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 +1166,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 +1177,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 +1331,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; } /* --- old/src/solaris/classes/sun/awt/X11/XWindow.java 2013-03-20 14:41:55.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XWindow.java 2013-03-20 14:41:55.000000000 +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()); @@ -1029,10 +1037,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 +1067,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 +1169,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 +1189,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; } --- old/src/solaris/classes/sun/awt/X11/XWindowPeer.java 2013-03-20 14:41:56.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11/XWindowPeer.java 2013-03-20 14:41:56.000000000 +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); } @@ -1900,7 +1904,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; --- old/src/solaris/classes/sun/awt/X11InputMethod.java 2013-03-20 14:41:58.000000000 +0400 +++ new/src/solaris/classes/sun/awt/X11InputMethod.java 2013-03-20 14:41:57.000000000 +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) { --- old/src/windows/classes/sun/awt/windows/WComponentPeer.java 2013-03-20 14:41:59.000000000 +0400 +++ new/src/windows/classes/sun/awt/windows/WComponentPeer.java 2013-03-20 14:41:58.000000000 +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) {