moosetechnology / FAST-JAVA

Represent the Java AST with Famix
https://modularmoose.org/moose-wiki/Developers/Parsers/FAST-Java.html
MIT License
1 stars 4 forks source link

`FASTJavaArrayInitializer>>#initializers` should be considered multivalued in the meta description #210

Open Gabriel-Darbord opened 11 months ago

Gabriel-Darbord commented 11 months ago

With @jecisc we would expect this attribute to be generated as a slot, but it uses the lazy attribute dictionary mechanism instead. We also expect the generated property to indicate that it is multivalued.

Generator:

    ((javaArrayInitializer property: #initializers) comment:
         'My initializers')
    <>-* ((tExpression property: #javaArrayInitializers) comment:
             'The owner of the expression').

Generated:

initializers
    "Relation named: #initializers type: #FASTTExpression opposite: #javaArrayInitializers"

    <generated>
    <FMComment: 'My initializers'>
    <derived>
    <FMProperty: #initializers type: #FASTTExpression opposite: #javaArrayInitializers>
    ^ self attributeAt: #initializers ifAbsentPut: [ FMMultivalueLink on: self opposite: #javaArrayInitializers: ]

Description: image

jecisc commented 11 months ago

@badetitou Do you have an idea why this does not generate a slot?

badetitou commented 11 months ago

FASTTExpression is part of the fast metamodel Et FastJavaArrayInitializer is part of the fast java metamodel

So the relation cannot be represented using a slot. Because in case you load only the fast project you would have a slot that is bind to nothing ( because fastjava is not loaded )

If I remember well the major concern is to not have dirty packages and avoid unsatisfied relationship

Gabriel-Darbord commented 11 months ago

Also, I don't get why it isn't "multivalued".

jecisc commented 11 months ago

Oh, I missed that FASTExpression was not in the same MM since both started with FAST. Thanks Benoit :)

But yes, there is also the bug of the multivalued.

I'll rename the issue