FUML 1.0b2 NO IDEA Avatar
  1. OMG Issue

FUML — CompoundValue::equals does not conform to Annex A conventions

  • Key: FUML-14
  • Legacy Issue Number: 13456
  • Status: closed  
  • Source: Model Driven Solutions ( Mr. Ed Seidewitz)
  • Summary:

    Specification: Semantics of a Foundation Subset for Executable UML Models, FTF – Beta 1 (ptc/08-11-03)
    Section: 8.3.2.2.2 CompoundValue

    Summary:

    The CompoundValue::equals operation has more than one return statement and uses the “&&”. These are not allowed by the conventions of Annex A.

    Proposed Resolution:

    Replace the body of the equals operation with:

    boolean isEqual = otherValue instanceof CompoundValue;

    if (isEqual) {

    CompoundValue otherCompoundValue = (CompoundValue)otherValue;

    // Debug.println("[equals] " + this.featureValues.size() + " feature(s).");

    isEqual = super.equals(otherValue) & otherCompoundValue.featureValues.size() == this.featureValues.size();

    int i = 1;

    while (isEqual & i <= this.featureValues.size()) {

    FeatureValue thisFeatureValue = this.featureValues.getValue(i-1);

    boolean matched = false;

    int j = 1;

    while (!matched & j <= otherCompoundValue.featureValues.size()) {

    FeatureValue otherFeatureValue = otherCompoundValue.featureValues.getValue(j-1);

    if (thisFeatureValue.feature == otherFeatureValue.feature)

    { matched = thisFeatureValue.hasEqualValues(otherFeatureValue); }

    j = j + 1;

    }

    isEqual = matched;

    i = i + 1;

    }

    }

    return isEqual;

  • Reported: FUML 1.0b1 — Fri, 6 Feb 2009 05:00 GMT
  • Disposition: Resolved — FUML 1.0b2
  • Disposition Summary:

    Change the code as proposed

  • Updated: Fri, 6 Mar 2015 20:58 GMT