Skip to content

Commit c99af85

Browse files
committed
Restored a correction to ElementAssembler so that, when assembling a
collection reference feature, it checks the in-memory repository for the target of a reference, if no assembler is found for it in the assembler map (as is done for a singular reference).
1 parent c11ec85 commit c99af85

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

org.modeldriven.fuml/src/main/java/org/modeldriven/fuml/assembly/ElementAssembler.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Initial version copyright 2008 Lockheed Martin Corporation, except
33
* as stated in the file entitled Licensing-Information.
44
*
5-
* All modifications copyright 2009-2011 Data Access Technologies, Inc.
5+
* All modifications copyright 2009-2015 Data Access Technologies, Inc.
66
* (Model Driven Solutions). Licensed under the Academic Free License version 3.0
77
* (http://www.opensource.org/licenses/afl-3.0.php), except as stated
88
* in the file entitled Licensing-Information.
@@ -706,7 +706,7 @@ private void assembleReferenceFeature(XmiReference reference) throws ClassNotFou
706706
InstantiationException, NoSuchFieldException {
707707
StreamNode eventNode = (StreamNode) this.getSource();
708708

709-
NamespaceDomain domain = null; // only lookup as needed
709+
// NamespaceDomain domain = null; // only lookup as needed
710710
Property property = this.prototype.getProperty(reference.getLocalName());
711711
Classifier type = property.getType();
712712

@@ -778,12 +778,19 @@ private void assembleReferenceFeature(XmiReference reference) throws ClassNotFou
778778
this.assembleCollectionReferenceFeature(referent, property, type);
779779
}
780780
} else {
781+
FumlObject target = null;
782+
781783
ElementAssembler referencedAssembler = this.assemblerMap.get(id);
782-
if (referencedAssembler == null)
784+
if (referencedAssembler != null)
785+
target = referencedAssembler.getTargetObject();
786+
else
787+
target = Environment.getInstance().findElementById(id);
788+
789+
if (target != null)
790+
this.assembleCollectionReferenceFeature(target, property, type);
791+
else
783792
throw new ValidationException(new ValidationError(reference, id,
784793
ErrorCode.INVALID_REFERENCE, ErrorSeverity.FATAL));
785-
this.assembleCollectionReferenceFeature(referencedAssembler.getTargetObject(),
786-
property, type);
787794
}
788795
}
789796
}

0 commit comments

Comments
 (0)