-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
Unconfigure a form while the model change can produce random exceptions.
It can be explained by multiple reasons :
- the form is still "attached" to model listeners during the unconfiguration process start
- changing the model from any thread can trigger change in view, but some elements are currently unconfigured
Here is a unit test that show to problem :
public class Issue199Test {
@Rule
public JavaFXRule javaFXRule = new JavaFXRule();
@Rule
public FailOnUncaughtExceptionRule failOnUncaughtExceptionRule = new FailOnUncaughtExceptionRule();
public class Bean {
private StringProperty value = new SimpleStringProperty();
public String getValue() { return value.get(); }
public StringProperty valueProperty() { return value; }
public void setValue(String value) { this.value.set(value); }
}
@Test
public void testToUnconfigureFormDuringAModelChange() throws InterruptedException {
Bean bean = new Bean();
FXForm form = new FXForm();
form.setSource(bean);
Thread thread = new Thread(() -> {
while (true) {
bean.setValue(UUID.randomUUID().toString());
}
});
thread.start();
Thread.sleep(3000); // Wait a little to be sure thread is start
form.setSource(null);
}
}Reactions are currently unavailable