JDK-6782344 : jfreechart_and_jxlayer applet throws NPE on OpenJDK
Type:Bug
Component:client-libs
Sub-Component:2d
Affected Version:7
Priority:P4
Status:Closed
Resolution:Cannot Reproduce
OS:generic
CPU:generic
Submitted:2008-12-08
Updated:2011-03-04
Resolved:2011-03-04
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
Applet from http://www.jroller.com/dgilbert/entry/jfreechart_and_jxlayer throws NPE with OpenJDK AA rendered (pisces).
Comments
EVALUATION
This is not reproducible since the fixes for 6967436 and 6967433 were integrated. I am closing this as "Not Reproducible".
04-03-2011
EVALUATION
We believe this is now fixed in the latest OpenJDK rasterizer, but the fixing engineer cannot run the applet via plugin or compile it from the published sources so we cannot specifically verify it.
14-02-2011
EVALUATION
Here is evaluation and suggested fix copied from (http://article.gmane.org/gmane.comp.java.openjdk.2d.devel/498)
------------------------------------------------------------------------------------------
From: Mark Wielaard <mark@...>
Subject: [OpenJDK 2D-Dev] Bug in pisces Renderer (uninitialized crossings)
Newsgroups: gmane.comp.java.openjdk.2d.devel, gmane.comp.java.openjdk.distro-packaging.devel
Date: 2008-10-27 14:53:32 GMT (6 weeks, 5 hours and 13 minutes ago)
Hi,
There is a bug in the pisces Renderer in crossingListFinished(). Both
crossings and crossingIndices might not have been initialized, so have
to be checked for being null. They only get initialized if
setCrossingsExtents() was called earlier, which might not always be the
case when crossingListFinished() is called from _endRendering().
You can see this with for example this applet (you will need to have the
IcedTeaPlugin installed):
http://www.jroller.com/dgilbert/entry/jfreechart_and_jxlayer
The magnifying glass will not work, and you will get an exception:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at sun.java2d.pisces.Renderer.crossingListFinished(Renderer.java:778)
at sun.java2d.pisces.Renderer._endRendering(Renderer.java:466)
at sun.java2d.pisces.Renderer.endRendering(Renderer.java:478)
at sun.java2d.pisces.PiscesRenderingEngine.getAATileGenerator(PiscesRenderingEngine.java:327)
at sun.java2d.pipe.AAShapePipe.renderPath(AAShapePipe.java:93)
at sun.java2d.pipe.AAShapePipe.fill(AAShapePipe.java:65)
at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:160)
at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2422)
at org.jfree.chart.plot.Plot.fillBackground(Plot.java:1021)
[...]
Attached is the workaround that I checked into IcedTea to make this work
reliably:
2008-10-27 Mark Wielaard <mark@...>
* patches/icedtea-renderer-crossing.patch: New patch.
* Makefile.am (ICEDTEA_PATCHES): Add new patch.
* HACKING: Document new patch.
Cheers,
Mark
--- openjdk6/jdk/src/share/classes/sun/java2d/pisces/Renderer.java 2008-08-28
10:14:15.000000000 +0200
+++ openjdk/jdk/src/share/classes/sun/java2d/pisces/Renderer.java 2008-10-27
13:54:25.000000000 +0100
@@ -775,10 +775,10 @@
// Free sorting arrays if larger than maximum size
private void crossingListFinished() {
- if (crossings.length > DEFAULT_CROSSINGS_SIZE) {
+ if (crossings != null && crossings.length > DEFAULT_CROSSINGS_SIZE) {
crossings = new int[DEFAULT_CROSSINGS_SIZE];
}
- if (crossingIndices.length > DEFAULT_INDICES_SIZE) {
+ if (crossingIndices != null && crossingIndices.length > DEFAULT_INDICES_SIZE) {
crossingIndices = new int[DEFAULT_INDICES_SIZE];
}
}