| Summary: | Anchor mechanism broken since at least Java 8u40 due to JavaFX bug (JDK-8136465). | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Matthias Wienand <matthias.wienand> |
| Component: | GEF MVC | Assignee: | Matthias Wienand <matthias.wienand> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | nyssen |
| Version: | 0.2.0 | ||
| Target Milestone: | 4.0.0 / 3.11.0 (Neon) M4 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Matthias Wienand
I could reproduce this first (with Java 8). Having updated to e(fx)clipse 2.1 and switched my BREE J2SE-1.7 bindings to (java8) and fro (java7), I can now no longer reproduce the issue (with Java 8). Very strange... I investigated further and found that a JavaFX bug [1] is responsible for the strange behavior: when removing a ChangeListener from a MapProperty, all ChangeListeners are removed by mistake. The bug is reported for Java version 8u60 and I could verify that anchors work correctly with 8u20 and 8u25, but do not work with 8u60 and 8u66. I did not test other versions, but I trust the bug report that the issue is fixed since Java 9. [1] https://bugs.openjdk.java.net/browse/JDK-8136465 Therefore, a workaround has to be implemented that keeps track of all registered ChangeListeners and re-registers the ChangeListeners when a ChangeListener is removed. We introduced org.eclipse.gef4.fx.internal.ReadOnlyMapWrapperEx as a (temporary) replacement for ReadOnlyMapWrapper. It uses a nested read-only property implementation that works around JDK-8136465 by keeping track of all listeners locally, and by adjusting the registered listeners of the underlying MapExpressionHelper as needed. Ensured ReadOnlyMapWrapperEx is used instead of ReadOnlyMapWrapper in all relevant places. All changes were pushed to origin/master. Resolving as fixed in 3.11.0 M4. Unless this Java bug is not resolved in a recent Java 8, we will have to leave the workaround in place until changing the BREE of the GEF4 FX bundle to Java 9. |