Skip to content

Commit 9bfef75

Browse files
committed
Updated resolution to OMG Issue FUML12-33/19008.
1 parent f554912 commit 9bfef75

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

  • org.modeldriven.fuml/src/main/java/fUML/Semantics/Loci/LociL1

org.modeldriven.fuml/src/main/java/fUML/Semantics/Loci/LociL1/Locus.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
public class Locus extends org.modeldriven.fuml.FumlObject {
2727

2828
public String identifier = Integer.toHexString(this.hashCode());
29-
public int nextValueId = 1;
3029
public fUML.Semantics.Loci.LociL1.Executor executor = null;
3130
public fUML.Semantics.Loci.LociL1.ExecutionFactory factory = null;
3231
public fUML.Semantics.Classes.Kernel.ExtensionalValueList extensionalValues = new fUML.Semantics.Classes.Kernel.ExtensionalValueList();
@@ -76,13 +75,21 @@ public void add(fUML.Semantics.Classes.Kernel.ExtensionalValue value) {
7675
// Add the given extensional value to this locus
7776

7877
value.locus = this;
78+
value.identifier = this.identifier + "#" + this.makeIdentifier(value);
7979
this.extensionalValues.addValue(value);
8080

81-
IntegerValue integerValue = new IntegerValue();
82-
integerValue.value = this.nextValueId;
83-
value.identifier = this.identifier + "#" + integerValue.toString();
84-
this.nextValueId = this.nextValueId + 1;
8581
} // add
82+
83+
public String makeIdentifier(fUML.Semantics.Classes.Kernel.ExtensionalValue value) {
84+
// Return an identifier for the given (newly created) extensional value.
85+
86+
// [No normative specification. A conforming implementation may create an identifier
87+
// an identifier in any way such that all identifiers for extensional values created
88+
// at any one locus are unique.]
89+
90+
// Non-normative Java implementation
91+
return Integer.toHexString(value.hashCode());
92+
} // makeIdentifier
8693

8794
public void remove(fUML.Semantics.Classes.Kernel.ExtensionalValue value) {
8895
// Remove the given extensional value from this locus.

0 commit comments

Comments
 (0)