Community
Participate
Working Groups
Please consider making the CanonicalConnectionEditPolicy#isOrphaned method tolerate corrupt models where the source or target of a connection cannot be resolved. This would allow the cannonical edit policy to create a new connection view to replace the one that is corrupt, since the semantic model is still intact. Proposed fix: protected boolean isOrphaned(Collection<EObject> semanticChildren, View view) { EObject element = view.getElement(); if (semanticChildren.contains(element)) { if (view instanceof Edge) { Edge edge = (Edge) view; if ((edge.getSource() == null || (edge.getSource().getElement() != getSourceElement(element))) || (edge.getTarget() == null || (edge.getTarget().getElement() != getTargetElement(element)))) return true; } } else { return true; } return false; } }
Created attachment 175311 [details] Proposed fix.
Alex, Lidija, can one of you review?
Looks good to me.
Committed to GMF Runtime HEAD (1.5.0) and GMF Runtime R1_4_maintenance.