コード例 #1
0
  public void relateAcrossR603To(Statement_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == IsSupertypeStatement) return; // already related

    if (IsSupertypeStatement != target) {

      Object oldKey = getInstanceKey();

      if (IsSupertypeStatement != null) {

        IsSupertypeStatement.clearBackPointerR603To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "AssignToMember_c.relateAcrossR603To(Statement_c target)",
              "Relate performed across R603 from Assign to Member to Statement without unrelate of prior instance.");
        }
      }

      IsSupertypeStatement = target;
      m_statement_id = target.getStatement_id();
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR603To(this);
      target.addRef();
    }
  }
コード例 #2
0
  public void unrelateAcrossR603From(Statement_c target, boolean notifyChanges) {
    if (target == null) return;

    if (IsSupertypeStatement == null) return; // already unrelated

    if (target != IsSupertypeStatement) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R603", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR603To(this);
    }

    if (IsSupertypeStatement != null) {

      m_statement_id = IsSupertypeStatement.getStatement_id();
      IsSupertypeStatement = null;
      target.removeRef();
    }
  }