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

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

    if (ReadsValue != target) {

      Object oldKey = getInstanceKey();

      if (ReadsValue != null) {

        ReadsValue.clearBackPointerR609To(this);

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

      ReadsValue = target;
      m_r_value_id = target.getValue_id();
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR609To(this);
      target.addRef();
    }
  }
コード例 #2
0
  public void unrelateAcrossR609From(Value_c target, boolean notifyChanges) {
    if (target == null) return;

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

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

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

    if (ReadsValue != null) {

      m_r_value_id = ReadsValue.getValue_id();
      ReadsValue = null;
      target.removeRef();
    }
  }