JDK-8095086 : [3D] NPE in NGShape.renderContent when drawing empty shapes
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-12-18
  • Updated: 2015-06-12
  • Resolved: 2014-03-26
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.

To download the current JDK release, click here.
JDK 8
8u20Fixed
Related Reports
Duplicate :  
Relates :  
Description
(build 119) : occured once rendering scene with PerspectiveCamera 

java.lang.NullPointerException
	at com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:207)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:225)
	at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:575)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:225)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2043)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1951)
	at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:469)
	at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:324)
	at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:89)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:129)
	at java.lang.Thread.run(Thread.java:744)
Comments
http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/335ad99f854f
26-03-2014

Unit tests: tests/system/src/test/java/test3d/RT35019Test.java
26-03-2014

Looks good. Approved.
26-03-2014

One more (minor) update to fix a problem with the name of the test class (else gradle will not execute it). I also updated the copyright date in NGShape. The fix itself is unchanged from the initial webrev. http://cr.openjdk.java.net/~kcr/RT-35019.02/
26-03-2014

Updated webrev with a regression test (the fix itself is unchanged). http://cr.openjdk.java.net/~kcr/RT-35019.01/ The regression test fails without the fix and passes with the fix.
26-03-2014

Please review the following: http://cr.openjdk.java.net/~kcr/RT-35019/ Reviewers: flar Simple fix to avoid creating a texture with 0 width or height (which will fail) and return without rendering anything, since there is nothing to render in that case anyway.
26-03-2014

This is caused by trying to draw a primitive whose bounds is 0 in either X or Y with a 3D transform. The following simple test case will reproduce the bug. import javafx.application.Application; import javafx.scene.Group; import javafx.scene.PerspectiveCamera; import javafx.scene.Scene; import javafx.scene.shape.Circle; import javafx.scene.text.Text; import javafx.scene.transform.Rotate; import javafx.stage.Stage; /** * Test program for rendering shapes with empty bounds and a 3D transform */ public class Test3DEmptyBounds extends Application { @Override public void start(Stage stage) { Circle emptyCircle = new Circle(10, 10, 0); Text emptyText = new Text(10, 100, ""); Group root = new Group(emptyCircle, emptyText); root.setRotationAxis(Rotate.Y_AXIS); root.setRotate(-30); Scene scene = new Scene(root, 400, 300); scene.setCamera(new PerspectiveCamera()); stage.setScene(scene); stage.show(); } public static void main(String[] args) { Application.launch(args); } }
26-03-2014

This is a regression introduced in FX 8 by the fix for RT-5534. The attached program runs fine in FX 2.
25-03-2014

JavaFXApplication1.zip sample application attached. run the application, click on green button, try to resize application window or try to rotate scene using mouse drag inside of scene. jdk used: jdk8 b123 x64 environment: win7 hint: cannot reproduce the bug without of line 85 in ColorApp1.java: nonresizeable.setTranslateZ(i);
22-01-2014

Affected tests: SceneGraphAutomated/test/scenegraph/functional/Layout3DTest/Anchor SceneGraphAutomated/test/scenegraph/functional/Layout3DTest/vbox1
24-12-2013

Victor, please attach a standalone test program that reproduces this, and then reopen it. Note that I have made this bug public since there is no reason for it to be internal.
18-12-2013

update: 100% reproducible with b120 8u-cpu build. Test scene consists of few VBoxes(HBoxes, FlowPanes) with circles and a button inside.
18-12-2013

Do you have a test case?
18-12-2013