jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java
changeset 4191 ca8d3ef845c8
parent 2805 9f18d7e66042
child 4214 0fa32d38146b
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Tue Aug 18 20:47:13 2009 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Aug 20 12:46:43 2009 +0400
@@ -253,7 +253,9 @@
      * Called when component receives focus
      */
     public void focusGained(FocusEvent e) {
-        focusLog.log(Level.FINE, "{0}", new Object[] {e});
+        if (focusLog.isLoggable(Level.FINE)) {
+            focusLog.log(Level.FINE, "{0}", new Object[] {String.valueOf(e)});
+        }
         bHasFocus = true;
     }
 
@@ -261,7 +263,9 @@
      * Called when component loses focus
      */
     public void focusLost(FocusEvent e) {
-        focusLog.log(Level.FINE, "{0}", new Object[] {e});
+        if (focusLog.isLoggable(Level.FINE)) {
+            focusLog.log(Level.FINE, "{0}", new Object[] {String.valueOf(e)});
+        }
         bHasFocus = false;
     }
 
@@ -414,7 +418,10 @@
      * @see java.awt.peer.ComponentPeer
      */
     public void setEnabled(boolean value) {
-        enableLog.log(Level.FINE, "{0}ing {1}", new Object[] {(value?"Enabl":"Disabl"), this});
+        if (enableLog.isLoggable(Level.FINE)) {
+            enableLog.log(Level.FINE, "{0}ing {1}",
+                          new Object[] {(value?"Enabl":"Disabl"), String.valueOf(this)});
+        }
         boolean repaintNeeded = (enabled != value);
         enabled = value;
         if (target instanceof Container) {
@@ -1262,7 +1269,10 @@
      * ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
      */
     protected boolean isEventDisabled(XEvent e) {
-        enableLog.log(Level.FINEST, "Component is {1}, checking for disabled event {0}", new Object[] {e, (isEnabled()?"enabled":"disable")});
+        if (enableLog.isLoggable(Level.FINEST)) {
+            enableLog.log(Level.FINEST, "Component is {1}, checking for disabled event {0}",
+                          new Object[] {String.valueOf(e), (isEnabled()?"enabled":"disable")});
+        }
         if (!isEnabled()) {
             switch (e.get_type()) {
               case XConstants.ButtonPress:
@@ -1272,7 +1282,9 @@
               case XConstants.EnterNotify:
               case XConstants.LeaveNotify:
               case XConstants.MotionNotify:
-                  enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {e});
+                  if (enableLog.isLoggable(Level.FINER)) {
+                      enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {String.valueOf(e)});
+                  }
                   return true;
             }
         }