Issue 17270: Structural Feature Actions on Data Values Need to Create a new Result Value (fuml-rtf) Source: Model Driven Solutions (Mr. Ed Seidewitz, ed-s(at)modeldriven.com) Nature: Uncategorized Issue Severity: Summary: Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclauses: 8.6.3.2.1 AddStructuralFeatureValueActionActivation, 8.6.3.2.3 ClearStructuralFeatureActionActivation, 8.6.3.2.12 RemoveStructuralFeatureValueAction Data values are not mutable, so, when given a data value, the structural feature actions are supposed to produce a new data value on the result pin, with the same feature values as for the input data value except for the structural feature on which the action acts. However, the current specifications for the activations of these actions do not copy the value before modifying it, resulting in an incorrect “in place” modification of the feature value of the original data value. Resolution: Agreed, with the understanding that the term “data value” means specifically an instance of a data type, not an object, which is an instance of a class. Only objects are passed as references, which allows them to be updated mutably. Any value that is not a reference is to be considered an immutable data value. Revised Text: In Subclauses 8.6.3.2.1, 8.6.3.2.3 and 8.6.3.2.12, in the respective doAction operations, after “} else if (value instanceof StructuredValue) {“, insert: // If the value is a data value, then it must be copied before // any change is made. if (!(value instanceof Reference)) { value = value.copy(); } Actions taken: March 23, 2012: received issue January 7, 2013: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issue@omg.org" Subject: Structural Feature Actions on Data Values Need to Create a new Result Value Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclauses: 8.6.3.2.1 AddStructuralFeatureValueActionActivation, 8.6.3.2.3 ClearStructuralFeatureActionActivation, 8.6.3.2.12 RemoveStructuralFeatureValueAction Data values are not mutable, so, when given a data value, the structural feature actions are supposed to produce a new data value on the result pin, with the same feature values as for the input data value except for the structural feature on which the action acts. However, the current specifications for the activations of these actions do not copy the value before modifying it, resulting in an incorrect .in place. modification of the feature value of the original data value.