提交 2e4a8cb2 编写于 作者: L leonidr

8014718: Netbeans IDE begins to throw a lot exceptions since 7u25 b10

Summary: Removed logging from SunToolkit
Reviewed-by: art
上级 604d0cc1
...@@ -48,8 +48,6 @@ import java.io.File; ...@@ -48,8 +48,6 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.*; import java.util.*;
import sun.util.logging.PlatformLogger;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeSupport;
import sun.awt.AppContext; import sun.awt.AppContext;
...@@ -1983,7 +1981,7 @@ public abstract class Toolkit { ...@@ -1983,7 +1981,7 @@ public abstract class Toolkit {
*/ */
public abstract boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType); public abstract boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType);
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Toolkit"); // 8014718: logging has been removed from SunToolkit
private static final int LONG_BITS = 64; private static final int LONG_BITS = 64;
private int[] calls = new int[LONG_BITS]; private int[] calls = new int[LONG_BITS];
...@@ -2150,12 +2148,6 @@ public abstract class Toolkit { ...@@ -2150,12 +2148,6 @@ public abstract class Toolkit {
} }
synchronized int countAWTEventListeners(long eventMask) { synchronized int countAWTEventListeners(long eventMask) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (eventMask == 0) {
log.fine("Assertion (eventMask != 0) failed");
}
}
int ci = 0; int ci = 0;
for (; eventMask != 0; eventMask >>>= 1, ci++) { for (; eventMask != 0; eventMask >>>= 1, ci++) {
} }
......
...@@ -58,7 +58,7 @@ public abstract class SunToolkit extends Toolkit ...@@ -58,7 +58,7 @@ public abstract class SunToolkit extends Toolkit
implements WindowClosingSupport, WindowClosingListener, implements WindowClosingSupport, WindowClosingListener,
ComponentFactory, InputMethodSupport, KeyboardFocusManagerPeerProvider { ComponentFactory, InputMethodSupport, KeyboardFocusManagerPeerProvider {
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.SunToolkit"); // 8014718: logging has been removed from SunToolkit
/* Load debug settings for native code */ /* Load debug settings for native code */
static { static {
...@@ -496,9 +496,7 @@ public abstract class SunToolkit extends Toolkit ...@@ -496,9 +496,7 @@ public abstract class SunToolkit extends Toolkit
setSystemGenerated(event); setSystemGenerated(event);
AppContext eventContext = targetToAppContext(event.getSource()); AppContext eventContext = targetToAppContext(event.getSource());
if (eventContext != null && !eventContext.equals(appContext)) { if (eventContext != null && !eventContext.equals(appContext)) {
if (log.isLoggable(PlatformLogger.FINE)) { throw new RuntimeException("Event posted on wrong app context : " + event);
log.fine("Event posted on wrong app context : " + event);
}
} }
PostEventQueue postEventQueue = PostEventQueue postEventQueue =
(PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY); (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
...@@ -889,10 +887,6 @@ public abstract class SunToolkit extends Toolkit ...@@ -889,10 +887,6 @@ public abstract class SunToolkit extends Toolkit
//with scale factors x1, x3/4, x2/3, xN, x1/N. //with scale factors x1, x3/4, x2/3, xN, x1/N.
Image im = i.next(); Image im = i.next();
if (im == null) { if (im == null) {
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconImage: " +
"Skipping the image passed into Java because it's null.");
}
continue; continue;
} }
if (im instanceof ToolkitImage) { if (im instanceof ToolkitImage) {
...@@ -905,10 +899,6 @@ public abstract class SunToolkit extends Toolkit ...@@ -905,10 +899,6 @@ public abstract class SunToolkit extends Toolkit
iw = im.getWidth(null); iw = im.getWidth(null);
ih = im.getHeight(null); ih = im.getHeight(null);
} catch (Exception e){ } catch (Exception e){
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconImage: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
}
continue; continue;
} }
if (iw > 0 && ih > 0) { if (iw > 0 && ih > 0) {
...@@ -980,14 +970,6 @@ public abstract class SunToolkit extends Toolkit ...@@ -980,14 +970,6 @@ public abstract class SunToolkit extends Toolkit
try { try {
int x = (width - bestWidth) / 2; int x = (width - bestWidth) / 2;
int y = (height - bestHeight) / 2; int y = (height - bestHeight) / 2;
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("WWindowPeer.getScaledIconData() result : " +
"w : " + width + " h : " + height +
" iW : " + bestImage.getWidth(null) + " iH : " + bestImage.getHeight(null) +
" sim : " + bestSimilarity + " sf : " + bestScaleFactor +
" adjW : " + bestWidth + " adjH : " + bestHeight +
" x : " + x + " y : " + y);
}
g.drawImage(bestImage, x, y, bestWidth, bestHeight, null); g.drawImage(bestImage, x, y, bestWidth, bestHeight, null);
} finally { } finally {
g.dispose(); g.dispose();
...@@ -998,10 +980,6 @@ public abstract class SunToolkit extends Toolkit ...@@ -998,10 +980,6 @@ public abstract class SunToolkit extends Toolkit
public static DataBufferInt getScaledIconData(java.util.List<Image> imageList, int width, int height) { public static DataBufferInt getScaledIconData(java.util.List<Image> imageList, int width, int height) {
BufferedImage bimage = getScaledIconImage(imageList, width, height); BufferedImage bimage = getScaledIconImage(imageList, width, height);
if (bimage == null) { if (bimage == null) {
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconData: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
}
return null; return null;
} }
Raster raster = bimage.getRaster(); Raster raster = bimage.getRaster();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册