if (containmentFeatureID == -1) { notifications = internalEObject.eInverseAdd (owner, InternalEObject.EOPPOSITE_FEATURE_BASE - getFeatureID(), null, notifications); } else { notifications = internalEObject.eInverseAdd (owner, InternalEObject.EOPPOSITE_FEATURE_BASE - containmentFeatureID, null, notifications); }
notifications = internalEObject.eInverseAdd (owner, InternalEObject.EOPPOSITE_FEATURE_BASE - (containmentFeatureID == -1 ? getFeatureID() : containmentFeatureID), null, notifications);
  public NotificationChain inverseAdd(Object object, NotificationChain notifications)  {    Entry entry = (Entry)object;    EStructuralFeature feature = entry.getEStructuralFeature();    if (feature instanceof EReference)    {      EReference eReference = (EReference)feature;      EReference eOpposite = eReference.getEOpposite();      if (eOpposite != null)      {        InternalEObject internalEObject = (InternalEObject)entry.getValue();        if (internalEObject != null)        {          notifications =             internalEObject.eInverseAdd              (owner,               internalEObject.eClass().getEAllStructuralFeatures().indexOf(eOpposite),               null,               notifications);        }      }      else if (eReference.isContainment())      {        InternalEObject internalEObject = (InternalEObject)entry.getValue();        if (internalEObject != null)        {          InternalEObject oldValue = (InternalEObject)internalEObject.eContainer();          int containmentFeatureID = owner.eClass().getEAllStructuralFeatures().indexOf(eReference);          // EATM to handle open content.          if (containmentFeatureID == -1)          {            notifications =              internalEObject.eInverseAdd                (owner,                 InternalEObject.EOPPOSITE_FEATURE_BASE - getFeatureID(),                 null,                 notifications);          }          else          {            notifications =              internalEObject.eInverseAdd                (owner,                 InternalEObject.EOPPOSITE_FEATURE_BASE - containmentFeatureID,                 null,                 notifications);          }        }      }    }    return notifications;  }