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

Bug 485470

Summary: graph builder can fail on 64 bit os
Product: [Tools] GEF Reporter: Arne Adams <arne.adams>
Component: GEF GraphAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Arne Adams CLA 2016-01-08 23:45:33 EST
at revision: master: [476556] Fix semantic zooming with the new scroll gesture. sha1id:dd09affa9f995583bc949615e113479cc7f58aec)

offending code:
org.eclipse.gef4.graph/src/org/eclipse/gef4/graph/Graph.java

		public Graph.Builder nodes(Node... nodes) {
			for (Node n : nodes) {
				this.nodes.put(System.identityHashCode(n), n);
			}
			return this;
		}
it may happen that 2 different nodes have identical hashcodes on 64bit system.
In that case put will silently overwrite the node value.
Comment 1 Alexander Nyßen CLA 2016-01-11 13:52:28 EST
Pushed the following changes to origin/master:

- Replace System.identityHashCode(n) with UUID.randomUUID();
- Add org.eclipse.gef4.graph.tests bundle and implemented some simple tests for Graph.Builder, which covers the key generation.

Resolving as fixed in 3.11.0 M5.