El sáb, 22-10-2011 a las 07:47 +0400, Oleg Sukhodolsky escribió: > Could you please use curly braces even for one-line ifs. It looks > like it is a part of the style. >
Sure I can. It is better to do so in my view. I just didn't because they are not used in 6 or 7 places in that same class. Anyway, here's the patch again.
# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/fede/Desarrollo/jdk7/jdk # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: src/solaris/classes/sun/awt/X11/XComponentPeer.java --- src/solaris/classes/sun/awt/X11/XComponentPeer.java Base (BASE) +++ src/solaris/classes/sun/awt/X11/XComponentPeer.java Locally Modified (Based On LOCAL) @@ -38,7 +38,6 @@ import java.awt.GraphicsConfiguration; import java.awt.Image; import java.awt.Insets; -import java.awt.KeyboardFocusManager; import java.awt.Rectangle; import java.awt.SystemColor; import java.awt.Toolkit; @@ -59,13 +58,10 @@ import java.awt.image.VolatileImage; import java.awt.peer.ComponentPeer; import java.awt.peer.ContainerPeer; -import java.awt.peer.LightweightPeer; import java.lang.reflect.*; import java.security.*; import java.util.Collection; -import java.util.HashSet; import java.util.Set; -import java.util.Vector; import sun.util.logging.PlatformLogger; import sun.awt.*; @@ -475,12 +471,16 @@ if (true) { switch(e.getID()) { case PaintEvent.UPDATE: + if(log.isLoggable(PlatformLogger.FINER)){ log.finer("XCP coalescePaintEvent : UPDATE : add : x = " + r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height); + } return; case PaintEvent.PAINT: + if(log.isLoggable(PlatformLogger.FINER)) { log.finer("XCP coalescePaintEvent : PAINT : add : x = " + r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height); + } return; } } @@ -1257,7 +1257,9 @@ * ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify */ protected boolean isEventDisabled(XEvent e) { + if(enableLog.isLoggable(PlatformLogger.FINEST)){ enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable")); + } if (!isEnabled()) { switch (e.get_type()) { case XConstants.ButtonPress: @@ -1267,7 +1269,9 @@ case XConstants.EnterNotify: case XConstants.LeaveNotify: case XConstants.MotionNotify: + if(enableLog.isLoggable(PlatformLogger.FINER)){ enableLog.finer("Event {0} is disable", e); + } return true; } }