Details
-
Bug
-
Resolution: Fixed
-
P3
-
9
Description
FULL PRODUCT VERSION :
This is the first build that exhibits the problem:
Java(TM) SE Runtime Environment (build 9-ea+124)
Java HotSpot(TM) Server VM (build 9-ea+124, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 3.4.63-2.44
A DESCRIPTION OF THE PROBLEM :
The fix toJDK-8139192 causes a null pointer exception in java.awt.Toolkit.createCustomCursor().
This breaks the popular jEdit text editor. The NPE happens on the EDT.
REGRESSION. Last worked in version 9
ADDITIONAL REGRESSION INFORMATION:
This is the last known good version:
Java(TM) SE Runtime Environment (build 9-ea+123)
Java HotSpot(TM) Server VM (build 9-ea+123, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case below to reproduce the NPE. This is an excerpt from the jEdit text editor that I have prepared for your convenience.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be no exception.
ACTUAL -
There is a null pointer exception (see below).
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.NullPointerException
at sun.awt.image.OffScreenImageSource.produce(java.desktop@9-ea/OffScreenImageSource.java:191)
at sun.awt.image.OffScreenImageSource.addConsumer(java.desktop@9-ea/OffScreenImageSource.java:66)
at sun.awt.image.OffScreenImageSource.startProduction(java.desktop@9-ea/OffScreenImageSource.java:80)
at java.awt.image.PixelGrabber.grabPixels(java.desktop@9-ea/PixelGrabber.java:259)
at java.awt.image.PixelGrabber.grabPixels(java.desktop@9-ea/PixelGrabber.java:226)
at sun.awt.CustomCursor.<init>(java.desktop@9-ea/CustomCursor.java:94)
at sun.awt.X11CustomCursor.<init>(java.desktop@9-ea/X11CustomCursor.java:44)
at sun.awt.X11.XCustomCursor.<init>(java.desktop@9-ea/XCustomCursor.java:43)
at sun.awt.X11.XToolkit.createCustomCursor(java.desktop@9-ea/XToolkit.java:1211)
at Bug8139192Regression.main(Bug8139192Regression.java:5)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Bug8139192Regression extends javax.swing.JFrame {
public static void main(String[] args) throws Exception {
final java.awt.Component component = new Bug8139192Regression();
component.getToolkit().createCustomCursor(
component.getGraphicsConfiguration().createCompatibleImage(
16, 16, java.awt.Transparency.BITMASK),
new java.awt.Point(0,0),
"Hidden");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
This is internal to AWT. There is no workaround. You have two options to fix this:
1) Back out bug #8139192
2) Change the call site in java.awt.Toolkit.createCustomCursor()
This is the first build that exhibits the problem:
Java(TM) SE Runtime Environment (build 9-ea+124)
Java HotSpot(TM) Server VM (build 9-ea+124, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 3.4.63-2.44
A DESCRIPTION OF THE PROBLEM :
The fix to
This breaks the popular jEdit text editor. The NPE happens on the EDT.
REGRESSION. Last worked in version 9
ADDITIONAL REGRESSION INFORMATION:
This is the last known good version:
Java(TM) SE Runtime Environment (build 9-ea+123)
Java HotSpot(TM) Server VM (build 9-ea+123, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case below to reproduce the NPE. This is an excerpt from the jEdit text editor that I have prepared for your convenience.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be no exception.
ACTUAL -
There is a null pointer exception (see below).
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.NullPointerException
at sun.awt.image.OffScreenImageSource.produce(java.desktop@9-ea/OffScreenImageSource.java:191)
at sun.awt.image.OffScreenImageSource.addConsumer(java.desktop@9-ea/OffScreenImageSource.java:66)
at sun.awt.image.OffScreenImageSource.startProduction(java.desktop@9-ea/OffScreenImageSource.java:80)
at java.awt.image.PixelGrabber.grabPixels(java.desktop@9-ea/PixelGrabber.java:259)
at java.awt.image.PixelGrabber.grabPixels(java.desktop@9-ea/PixelGrabber.java:226)
at sun.awt.CustomCursor.<init>(java.desktop@9-ea/CustomCursor.java:94)
at sun.awt.X11CustomCursor.<init>(java.desktop@9-ea/X11CustomCursor.java:44)
at sun.awt.X11.XCustomCursor.<init>(java.desktop@9-ea/XCustomCursor.java:43)
at sun.awt.X11.XToolkit.createCustomCursor(java.desktop@9-ea/XToolkit.java:1211)
at Bug8139192Regression.main(Bug8139192Regression.java:5)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class Bug8139192Regression extends javax.swing.JFrame {
public static void main(String[] args) throws Exception {
final java.awt.Component component = new Bug8139192Regression();
component.getToolkit().createCustomCursor(
component.getGraphicsConfiguration().createCompatibleImage(
16, 16, java.awt.Transparency.BITMASK),
new java.awt.Point(0,0),
"Hidden");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
This is internal to AWT. There is no workaround. You have two options to fix this:
1) Back out bug #8139192
2) Change the call site in java.awt.Toolkit.createCustomCursor()
Attachments
Issue Links
- duplicates
-
JDK-8160461 NPE with JEdit520 after change for JDK-8139192 (9-b124)
- Closed
- relates to
-
JDK-8139192 Custom ImageFilters return blank images in Java 8(.45) while working in 7
- Resolved