Problem during export of MSE (SourceAnchor duplicated)

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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
                name: 'Package';
                mooseModel: model;
        FAMIXClass new
                name: 'Class';
                container: package;
                        (FAMIXSourceTextAnchor new
                                source: 'some text';
                                mooseModel: model;
                mooseModel: model.
        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:

values do: [ :each |
    (self isPrimitiveTypeOrObject: each)
        ifTrue: [
            printer referenceName: each name ]
        ifFalse: [
            printer referenceNumber: (self indexOf: each) ]]

I don't know the "composite" and "container" system of FAME enough to
know how to correct this problem now.

If someone knows the importer/exporter I would appreciate help with this

Cyril Ferlicot
2 rue Jacques Prévert 01,
59650 Villeneuve d'ascq France

Moose-dev mailing list
[hidden email]

signature.asc (817 bytes) Download Attachment