--- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Tue Aug 18 20:47:13 2009 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Thu Aug 20 12:46:43 2009 +0400
@@ -79,7 +79,9 @@
Rectangle bounds = (Rectangle)params.get(BOUNDS);
dimensions = new WindowDimensions(bounds, getRealInsets(), false);
params.put(BOUNDS, dimensions.getClientRect());
- insLog.log(Level.FINE, "Initial dimensions {0}", new Object[] { dimensions });
+ if (insLog.isLoggable(Level.FINE)) {
+ insLog.log(Level.FINE, "Initial dimensions {0}",new Object[] { String.valueOf(dimensions) });
+ }
// Deny default processing of these events on the shell - proxy will take care of
// them instead
@@ -265,7 +267,10 @@
wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
}
- insLog.log(Level.FINER, "FRAME_EXTENTS: {0}", new Object[]{wm_set_insets});
+ if (insLog.isLoggable(Level.FINER)) {
+ insLog.log(Level.FINER, "FRAME_EXTENTS: {0}",
+ new Object[]{String.valueOf(wm_set_insets)});
+ }
if (wm_set_insets != null) {
wm_set_insets = copy(wm_set_insets);
@@ -331,7 +336,10 @@
// Check if we have insets provided by the WM
Insets correctWM = getWMSetInsets(null);
if (correctWM != null) {
- insLog.log(Level.FINER, "wm-provided insets {0}", new Object[]{correctWM});
+ if (insLog.isLoggable(Level.FINER)) {
+ insLog.log(Level.FINER, "wm-provided insets {0}",
+ new Object[]{String.valueOf(correctWM)});
+ }
// If these insets are equal to our current insets - no actions are necessary
Insets dimInsets = dimensions.getInsets();
if (correctWM.equals(dimInsets)) {
@@ -345,7 +353,9 @@
correctWM = XWM.getWM().getInsets(this, xe.get_window(), xe.get_parent());
if (correctWM != null) {
- insLog.log(Level.FINER, "correctWM {0}", new Object[] {correctWM});
+ if (insLog.isLoggable(Level.FINE)) {
+ insLog.log(Level.FINER, "correctWM {0}", new Object[] {String.valueOf(correctWM)});
+ }
} else {
insLog.log(Level.FINER, "correctWM insets are not available, waiting for configureNotify");
}
@@ -368,7 +378,10 @@
* initial insets were wrong (most likely they were).
*/
Insets correction = difference(correctWM, currentInsets);
- insLog.log(Level.FINEST, "Corrention {0}", new Object[] {correction});
+ if (insLog.isLoggable(Level.FINEST)) {
+ insLog.log(Level.FINEST, "Corrention {0}",
+ new Object[] {String.valueOf(correction)});
+ }
if (!isNull(correction)) {
currentInsets = copy(correctWM);
applyGuessedInsets();
@@ -453,7 +466,7 @@
Insets in = copy(getRealInsets());
in.top += getMenuBarHeight();
if (insLog.isLoggable(Level.FINEST)) {
- insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
+ insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {String.valueOf(in)});
}
return in;
}
@@ -610,7 +623,7 @@
break;
}
if (insLog.isLoggable(Level.FINE)) insLog.log(Level.FINE, "For the operation {0} new dimensions are {1}",
- new Object[] {operationToString(operation), dims});
+ new Object[] {operationToString(operation), String.valueOf(dims)});
reshape(dims, operation, userReshape);
}
@@ -640,7 +653,9 @@
public void handleConfigureNotifyEvent(XEvent xev) {
assert (SunToolkit.isAWTLockHeldByCurrentThread());
XConfigureEvent xe = xev.get_xconfigure();
- insLog.log(Level.FINE, "Configure notify {0}", new Object[] {xe});
+ if (insLog.isLoggable(Level.FINE)) {
+ insLog.log(Level.FINE, "Configure notify {0}", new Object[] {String.valueOf(xe)});
+ }
// XXX: should really only consider synthetic events, but
if (isReparented()) {
@@ -732,7 +747,10 @@
case XWM.SAWFISH_WM:
{
Point xlocation = queryXLocation();
- if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "New X location: {0}", new Object[]{xlocation});
+ if (log.isLoggable(Level.FINE)) {
+ log.log(Level.FINE, "New X location: {0}",
+ new Object[]{String.valueOf(xlocation)});
+ }
if (xlocation != null) {
newLocation = xlocation;
}
@@ -749,8 +767,10 @@
copy(currentInsets),
true);
- insLog.log(Level.FINER, "Insets are {0}, new dimensions {1}",
- new Object[] {currentInsets, newDimensions});
+ if (insLog.isLoggable(Level.FINER)) {
+ insLog.log(Level.FINER, "Insets are {0}, new dimensions {1}",
+ new Object[] {String.valueOf(currentInsets), String.valueOf(newDimensions)});
+ }
checkIfOnNewScreen(newDimensions.getBounds());
@@ -917,7 +937,7 @@
Point location = target.getLocation();
if (insLog.isLoggable(Level.FINE))
insLog.log(Level.FINE, "getLocationOnScreen {0} not reparented: {1} ",
- new Object[] {this, location});
+ new Object[] {String.valueOf(this), String.valueOf(location)});
return location;
}
} finally {
@@ -954,7 +974,10 @@
}
public void setVisible(boolean vis) {
- log.log(Level.FINER, "Setting {0} to visible {1}", new Object[] {this, Boolean.valueOf(vis)});
+ if (log.isLoggable(Level.FINE)) {
+ log.log(Level.FINER, "Setting {0} to visible {1}",
+ new Object[] {String.valueOf(this), Boolean.valueOf(vis)});
+ }
if (vis && !isVisible()) {
XWM.setShellDecor(this);
super.setVisible(vis);
@@ -1005,7 +1028,9 @@
}
private void handleWmTakeFocus(XClientMessageEvent cl) {
- focusLog.log(Level.FINE, "WM_TAKE_FOCUS on {0}", new Object[]{this});
+ if (focusLog.isLoggable(Level.FINE)) {
+ focusLog.log(Level.FINE, "WM_TAKE_FOCUS on {0}", new Object[]{String.valueOf(this)});
+ }
requestWindowFocus(cl.get_data(1), true);
}