-
Bug
-
Resolution: Fixed
-
P3
-
fx2.0
-
Windows 7, JavaFX 2.0 beta b31
Running the following code results in a NullPointerException. An attempt to set an empty stop list should probably either be ignored or cause the stops to be reset to their default values. RadialGradientBuilder exhibits the same behavior.
public class TestEmptyStrokeList extends Application {
@Override
public void start(Stage stage) throws Exception {
Rectangle r = new Rectangle(200, 200);
r.setFill(new LinearGradientBuilder().stops(new ArrayList<Stop>()).build());
Scene s = new Scene(new Group(r), 220, 220);
stage.setScene(s);
stage.setVisible(true);
}
public static void main(String[] args) {
Application.launch(args);
}
}
Output:
java.lang.NullPointerException
at com.sun.prism.impl.ps.PaintHelper.getGradientTexture(PaintHelper.java:91)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:346)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:246)
at com.sun.prism.impl.ps.BaseShaderGraphics.fillQuad(BaseShaderGraphics.java:559)
at com.sun.prism.impl.shape.BasicRoundRectRep.fillRoundRect(BasicRoundRectRep.java:35)
at com.sun.prism.impl.shape.BasicRoundRectRep.fill(BasicRoundRectRep.java:21)
at com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:130)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:103)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:34)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1000)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:179)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:103)
at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:290)
at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:27)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1000)
at com.sun.javafx.tk.quantum.PaintRunnable.paintImpl(PaintRunnable.java:137)
at com.sun.javafx.tk.quantum.PaintRunnable.run(PaintRunnable.java:236)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at com.sun.prism.render.RenderJob.run(RenderJob.java:29)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at com.sun.javafx.tk.quantum.QuantumRenderer$ObservedRunnable.run(QuantumRenderer.java:70)
at java.lang.Thread.run(Thread.java:619)
public class TestEmptyStrokeList extends Application {
@Override
public void start(Stage stage) throws Exception {
Rectangle r = new Rectangle(200, 200);
r.setFill(new LinearGradientBuilder().stops(new ArrayList<Stop>()).build());
Scene s = new Scene(new Group(r), 220, 220);
stage.setScene(s);
stage.setVisible(true);
}
public static void main(String[] args) {
Application.launch(args);
}
}
Output:
java.lang.NullPointerException
at com.sun.prism.impl.ps.PaintHelper.getGradientTexture(PaintHelper.java:91)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:346)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:246)
at com.sun.prism.impl.ps.BaseShaderGraphics.fillQuad(BaseShaderGraphics.java:559)
at com.sun.prism.impl.shape.BasicRoundRectRep.fillRoundRect(BasicRoundRectRep.java:35)
at com.sun.prism.impl.shape.BasicRoundRectRep.fill(BasicRoundRectRep.java:21)
at com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:130)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:103)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:34)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1000)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:179)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:103)
at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:290)
at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:27)
at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1000)
at com.sun.javafx.tk.quantum.PaintRunnable.paintImpl(PaintRunnable.java:137)
at com.sun.javafx.tk.quantum.PaintRunnable.run(PaintRunnable.java:236)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at com.sun.prism.render.RenderJob.run(RenderJob.java:29)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at com.sun.javafx.tk.quantum.QuantumRenderer$ObservedRunnable.run(QuantumRenderer.java:70)
at java.lang.Thread.run(Thread.java:619)
- relates to
-
JDK-8128991 fx LinearGradient not aligned with awt LinearGradientPaint
-
- Closed
-