PieChart fails to initialize in a background thread. To reproduce, use the newly developed NodeInitializationStressTest:
```
@Test
public void pieChart() {
test(() -> {
PieChart c = new PieChart();
c.getData().setAll(createPieSeries());
return c;
}, (c) -> {
c.getData().setAll(createPieSeries());
accessChart(c);
});
}
```
Exception:
java.lang.ArrayIndexOutOfBoundsException: Index 40 out of bounds for length 40
at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.addListener(ExpressionHelper.java:248)
at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.addListener(ExpressionHelper.java:1)
at javafx.base/com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:65)
at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.addListener(ReadOnlyBooleanPropertyBase.java:52)
at javafx.base/javafx.beans.property.BooleanPropertyBase.bind(BooleanPropertyBase.java:176)
at javafx.graphics/javafx.css.StyleableBooleanProperty.bind(StyleableBooleanProperty.java:96)
at javafx.controls/javafx.scene.chart.PieChart$Data.<init>(PieChart.java:1008)
at test.robot.javafx.scene.NodeInitializationBackgroundThreadTest.createPieSeries(NodeInitializationBackgroundThreadTest.java:553)
at test.robot.javafx.scene.NodeInitializationBackgroundThreadTest.lambda$37(NodeInitializationBackgroundThreadTest.java:360)
at test.robot.javafx.scene.NodeInitializationBackgroundThreadTest$1.run(NodeInitializationBackgroundThreadTest.java:465)
```
@Test
public void pieChart() {
test(() -> {
PieChart c = new PieChart();
c.getData().setAll(createPieSeries());
return c;
}, (c) -> {
c.getData().setAll(createPieSeries());
accessChart(c);
});
}
```
Exception:
java.lang.ArrayIndexOutOfBoundsException: Index 40 out of bounds for length 40
at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.addListener(ExpressionHelper.java:248)
at javafx.base/com.sun.javafx.binding.ExpressionHelper$Generic.addListener(ExpressionHelper.java:1)
at javafx.base/com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:65)
at javafx.base/javafx.beans.property.ReadOnlyBooleanPropertyBase.addListener(ReadOnlyBooleanPropertyBase.java:52)
at javafx.base/javafx.beans.property.BooleanPropertyBase.bind(BooleanPropertyBase.java:176)
at javafx.graphics/javafx.css.StyleableBooleanProperty.bind(StyleableBooleanProperty.java:96)
at javafx.controls/javafx.scene.chart.PieChart$Data.<init>(PieChart.java:1008)
at test.robot.javafx.scene.NodeInitializationBackgroundThreadTest.createPieSeries(NodeInitializationBackgroundThreadTest.java:553)
at test.robot.javafx.scene.NodeInitializationBackgroundThreadTest.lambda$37(NodeInitializationBackgroundThreadTest.java:360)
at test.robot.javafx.scene.NodeInitializationBackgroundThreadTest$1.run(NodeInitializationBackgroundThreadTest.java:465)
- blocks
-
JDK-8348987 ☂ Thread safety in Node initialization
-
- In Progress
-
- duplicates
-
JDK-8349091 Charts: exception initializing in a background thread
-
- Resolved
-