@ Override protected void clearReference ( EObject obj , EReference ref ) { super . clearReference ( obj , ref ) ; if ( obj . eIsSet ( ref ) && ref . getEType ( ) . equals ( XtextPackage . Literals . TYPE_REF ) ) { INode node = NodeModelUtils . getNode ( ( EObject ) obj . eGet ( ref ) ) ; if ( node == null ) obj . eUnset ( ref ) ; } if ( obj . eIsSet ( ref ) && ref == XtextPackage . Literals . CROSS_REFERENCE__TERMINAL ) { INode node = NodeModelUtils . getNode ( ( EObject ) obj . eGet ( ref ) ) ; if ( node == null ) obj . eUnset ( ref ) ; } if ( ref == XtextPackage . Literals . RULE_CALL__RULE ) { obj . eUnset ( XtextPackage . Literals . RULE_CALL__EXPLICITLY_CALLED ) ; } }
We add typeRefs without Nodes on the fly so we should remove them before relinking .