--- a/jdk/src/share/classes/java/awt/Container.java Tue Sep 29 09:02:00 2009 -0700
+++ b/jdk/src/share/classes/java/awt/Container.java Tue Sep 29 16:03:03 2009 -0700
@@ -46,10 +46,10 @@
import java.util.HashSet;
import java.util.Set;
-import java.util.logging.*;
-
import javax.accessibility.*;
+import sun.util.logging.PlatformLogger;
+
import sun.awt.AppContext;
import sun.awt.CausedFocusEvent;
import sun.awt.PeerEvent;
@@ -85,8 +85,8 @@
*/
public class Container extends Component {
- private static final Logger log = Logger.getLogger("java.awt.Container");
- private static final Logger eventLog = Logger.getLogger("java.awt.event.Container");
+ private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Container");
+ private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Container");
private static final Component[] EMPTY_ARRAY = new Component[0];
@@ -201,7 +201,7 @@
private transient int numOfHWComponents = 0;
private transient int numOfLWComponents = 0;
- private static final Logger mixingLog = Logger.getLogger("java.awt.mixing.Container");
+ private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Container");
/**
* @serialField ncomponents int
@@ -1287,33 +1287,33 @@
int superListening = super.numListening(mask);
if (mask == AWTEvent.HIERARCHY_EVENT_MASK) {
- if (eventLog.isLoggable(Level.FINE)) {
+ if (eventLog.isLoggable(PlatformLogger.FINE)) {
// Verify listeningChildren is correct
int sum = 0;
for (Component comp : component) {
sum += comp.numListening(mask);
}
if (listeningChildren != sum) {
- eventLog.log(Level.FINE, "Assertion (listeningChildren == sum) failed");
+ eventLog.fine("Assertion (listeningChildren == sum) failed");
}
}
return listeningChildren + superListening;
} else if (mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) {
- if (eventLog.isLoggable(Level.FINE)) {
+ if (eventLog.isLoggable(PlatformLogger.FINE)) {
// Verify listeningBoundsChildren is correct
int sum = 0;
for (Component comp : component) {
sum += comp.numListening(mask);
}
if (listeningBoundsChildren != sum) {
- eventLog.log(Level.FINE, "Assertion (listeningBoundsChildren == sum) failed");
+ eventLog.fine("Assertion (listeningBoundsChildren == sum) failed");
}
}
return listeningBoundsChildren + superListening;
} else {
// assert false;
- if (eventLog.isLoggable(Level.FINE)) {
- eventLog.log(Level.FINE, "This code must never be reached");
+ if (eventLog.isLoggable(PlatformLogger.FINE)) {
+ eventLog.fine("This code must never be reached");
}
return superListening;
}
@@ -1321,13 +1321,13 @@
// Should only be called while holding tree lock
void adjustListeningChildren(long mask, int num) {
- if (eventLog.isLoggable(Level.FINE)) {
+ if (eventLog.isLoggable(PlatformLogger.FINE)) {
boolean toAssert = (mask == AWTEvent.HIERARCHY_EVENT_MASK ||
mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK ||
mask == (AWTEvent.HIERARCHY_EVENT_MASK |
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK));
if (!toAssert) {
- eventLog.log(Level.FINE, "Assertion failed");
+ eventLog.fine("Assertion failed");
}
}
@@ -1362,14 +1362,14 @@
// Should only be called while holding tree lock
int countHierarchyMembers() {
- if (log.isLoggable(Level.FINE)) {
+ if (log.isLoggable(PlatformLogger.FINE)) {
// Verify descendantsCount is correct
int sum = 0;
for (Component comp : component) {
sum += comp.countHierarchyMembers();
}
if (descendantsCount != sum) {
- log.log(Level.FINE, "Assertion (descendantsCount == sum) failed");
+ log.fine("Assertion (descendantsCount == sum) failed");
}
}
return descendantsCount + 1;
@@ -3924,7 +3924,7 @@
final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) {
checkTreeLock();
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder);
}
@@ -3961,7 +3961,7 @@
final void recursiveApplyCurrentShape(int fromZorder, int toZorder) {
checkTreeLock();
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; fromZ=" + fromZorder + "; toZ=" + toZorder);
}
@@ -4065,7 +4065,7 @@
@Override
void mixOnShowing() {
synchronized (getTreeLock()) {
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
@@ -4090,7 +4090,7 @@
@Override
void mixOnHiding(boolean isLightweight) {
synchronized (getTreeLock()) {
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; isLightweight=" + isLightweight);
}
@@ -4104,7 +4104,7 @@
@Override
void mixOnReshaping() {
synchronized (getTreeLock()) {
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
@@ -4139,7 +4139,7 @@
@Override
void mixOnZOrderChanging(int oldZorder, int newZorder) {
synchronized (getTreeLock()) {
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; oldZ=" + oldZorder + "; newZ=" + newZorder);
}
@@ -4160,7 +4160,7 @@
@Override
void mixOnValidating() {
synchronized (getTreeLock()) {
- if (mixingLog.isLoggable(Level.FINE)) {
+ if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
@@ -4206,7 +4206,7 @@
*/
private static final int LWD_MOUSE_DRAGGED_OVER = 1500;
- private static final Logger eventLog = Logger.getLogger("java.awt.event.LightweightDispatcher");
+ private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.LightweightDispatcher");
LightweightDispatcher(Container nativeContainer) {
this.nativeContainer = nativeContainer;
@@ -4348,10 +4348,10 @@
// This may send it somewhere that doesn't have MouseWheelEvents
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
- if (eventLog.isLoggable(Level.FINEST) && (mouseOver != null)) {
- eventLog.log(Level.FINEST, "retargeting mouse wheel to " +
- mouseOver.getName() + ", " +
- mouseOver.getClass());
+ if (eventLog.isLoggable(PlatformLogger.FINEST) && (mouseOver != null)) {
+ eventLog.finest("retargeting mouse wheel to " +
+ mouseOver.getName() + ", " +
+ mouseOver.getClass());
}
retargetMouseEvent(mouseOver, id, e);
break;