Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 486416

Summary: Property related tests for bidirectionalBinding fail on Java 7u45.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF CommonAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2016-01-23 10:02:15 EST
When running on Java 7u45, the bidirectionalBinding-related tests within MapPropertyExTests, SimplePropertyExTests, and ListPropertyExTests fail because the resulting properties are not equal (while we expect them to be). In addition, the bidirectionalBinding-related tests of SetMultimapPropertyTest and MultisetPropertyTests fail because BidirectionalBindings.checkParameters throws an IllegalArgumentException ("Cannot bind property to itself"). All tests pass successfully on Java 8.

The sources of JavaFX 2 are not public and I cannot find a related JDK bug, but I assume that for Java 7u45 (i.e JavaFX 2) the following holds: 

1) Equality of properties seems to be based based on object identity. This would explain why the MapPropertyExTests, SimplePropertyExTests, and ListPropertyExTests fail, as on JavaFX8 they seem to be equal.
2) BidirectionalBindings.checkParameters(Property, Property) seems to test for equality rather than identity. This would explain why the other tests for our own property implementations fail (SetMultimapPropertyTest and MultisetPropertyTests) fail, as their equality is not based on identity.

We should try to find a JDK bug that confirms this assumption. Also, as we want to still support Java7 (i.e. JavaFX 2) for the Neon release, we should check wether we can provide a workaround for Java7.
Comment 1 Alexander Nyßen CLA 2016-01-23 12:01:02 EST
It seems that https://bugs.openjdk.java.net/browse/JDK-8120138 is the related JavaFX bug.
Comment 2 Alexander Nyßen CLA 2016-01-25 13:24:57 EST
I created additional replacement classes for SimpleSetProperty and SimpleListProperty and adjusted the implementations of all our property classes (and replacements) to compensate the different equals() and hashCode() implementations on Java 7. While bidirectional bindings can now be created using the respective methods on the properties, using the static utilities within JavaFX 2.2's Bindings class will not work, because it is completely based on JavaFX 2.2 equality. All changes pushed to origin/master.

Resolving this as fixed in 3.11.0 M5.