Problem during export of MSE (SourceAnchor duplicated)
In the latest Moose when I export a model with source anchors they are
not exported right. If I have a class referencing the sourceAnchor, the
source anchor is exported one time as an element and one time as an
attribute of the class instead of using a ref.
To explicit the problem:
| model package tempFile importedModel |
model := MooseModel new name: 'Model'.
package := FAMIXPackage new
source: 'some text';
tempFile := (FileSystem memory / 'export-test.mse') ensureCreateFile.
model exportToMSEStream: tempFile writeStream.
importedModel := MooseModel new importFromMSEStream: tempFile readStream.
self assert: importedModel size equals: model size
This test was added to Moose yesterday.
The change of behavior was introduced with the <container> pragma.
In the method FMRepositoryVisitor>>exportProperty:withAll:, the
sourceAnchor property is now detected as a composite and the branch used
to export the property is values do: [ :each | self exportElement: each
]. Before the introduction of the <container> pragma, the property was
not a composite and the branch executed was: