Bug 509850 - Sirius ignore return types given by AQL if it is a collection type.
Summary: Sirius ignore return types given by AQL if it is a collection type.
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 4.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.0.0   Edit
Assignee: Project inbox CLA
QA Contact: Pierre-Charles David CLA
URL:
Whiteboard: backport
Keywords: noteworthy, triaged
Depends on:
Blocks:
 
Reported: 2017-01-03 06:16 EST by Cedric Brun CLA
Modified: 2017-06-29 03:32 EDT (History)
2 users (show)

See Also:


Attachments
Archived VSM project to reproduce the error (6.24 KB, application/zip)
2017-01-03 06:17 EST, Cedric Brun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2017-01-03 06:16:20 EST
Steps to reproduce:
1- write a tool definition with a "For" expression which uses AQL and for which the return type is a collection of known types for instance with "container" being an EPackage use the expression:
  aql:container.eClassifiers
2- add a browse expression within the block of this for which uses a feature specific to the corresponding type (here EClassifier), for instance:
  aql:i.name

When validating the .odesign an error "Feature not found in EClass EObject" is triggered whereas the expectation is that the tool is valid.
Comment 1 Cedric Brun CLA 2017-01-03 06:17:33 EST
Created attachment 266093 [details]
Archived VSM project to reproduce the error
Comment 2 Cedric Brun CLA 2017-01-03 06:19:55 EST
Looking at the code AQLSiriusInterpreter.analyzeExpression(IInterpreterContext, String) actually ignore the type returned by AQL if it is not an EClassifierType and won't return the value at all, leading to a fall-back to EObject.  Sirius has no notion of "multiple" or "collection" type in its typesystem and will unwrap the collection when using its result as the root of a new expression. It seems better to return the type information than hide which leads to a fall-back to EObject.
Comment 3 Eclipse Genie CLA 2017-01-03 08:45:20 EST
New Gerrit change created: https://git.eclipse.org/r/87940
Comment 5 Pierre-Charles David CLA 2017-01-11 15:59:02 EST
Fixed by 7b0f6b1c494034864d2fde91add471808d08b706. The new test case for this scenario is added directly in the same commit.
Comment 6 Pierre-Charles David CLA 2017-05-19 05:42:25 EDT
Verified on Sirius 5.0M7.
Comment 7 Pierre-Charles David CLA 2017-06-29 03:32:38 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.