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

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

    if (ReferencesVariable != target) {

      Object oldKey = getInstanceKey();

      if (ReferencesVariable != null) {

        ReferencesVariable.clearBackPointerR805To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "TransientValueReference_c.relateAcrossR805To(Variable_c target)",
              "Relate performed across R805 from Transient Value Reference to Variable without unrelate of prior instance.");
        }
      }

      ReferencesVariable = target;
      m_var_id = target.getVar_id();
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR805To(this);
      target.addRef();
    }
  }
コード例 #2
0
  public void unrelateAcrossR805From(Variable_c target, boolean notifyChanges) {
    if (target == null) return;

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

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

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

    if (ReferencesVariable != null) {

      m_var_id = ReferencesVariable.getVar_id();
      ReferencesVariable = null;
      target.removeRef();
    }
  }