Bug 516734 - Being clear regarding the Java services returning List or Set and not "Collection"
Summary: Being clear regarding the Java services returning List or Set and not "Collec...
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 4.1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 5.1.0   Edit
Assignee: Florian Barbin CLA
QA Contact:
URL:
Whiteboard: backport validation services
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-05-16 10:08 EDT by Cedric Brun CLA
Modified: 2017-11-08 03:37 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2017-05-16 10:08:36 EDT
AQL only supports Sequences and Set as collection types, because of this any Java service defined by the end user which returns a "Collection<SomeEClass>" will be considered as a plain Java type (java.lang.Collection) hence defeating any usefull diagnostic during validation.

We might want to make sure that any services provide "by default" is conform with this constraint or the end user is getting a poor validation bu default.

We might also want to make sure that the documentation is clear regarding the use of List<> and Set<> in the services as the prefered return type in order to get the best validation possible.
Comment 1 Eclipse Genie CLA 2017-05-16 10:17:59 EDT
New Gerrit change created: https://git.eclipse.org/r/97240
Comment 3 Pierre-Charles David CLA 2017-06-12 08:47:09 EDT
Apparently a first patch was merged in M7. Moving to 5.1 to finish the work (reviewing the services shipped with Sirius, and completing the documentation).

Marking as backport candidate, especially if in the end only the documentation is impacted.
Comment 4 Eclipse Genie CLA 2017-09-07 11:07:25 EDT
New Gerrit change created: https://git.eclipse.org/r/104663
Comment 6 Julien Dupont CLA 2017-09-20 08:49:08 EDT
Can not be verified: missing or incomplete reproduction information.
Comment 7 Pierre-Charles David CLA 2017-09-20 10:53:14 EDT
Steps to validate:
1. The documentation on using services from AQL expressions should mention clearly that the generic type "Collection" should not be used in service methods signatures. Only "List" or "Set" should be used to ensure good compatibility with AQL.
2. The standard services we provide in Sirius itself should follow these recommendations. This includes mainly org.eclipse.sirius.ext.emf.edit.EditingDomainServices and the Java services defined in our sample modelers (the 3 "basicfamily" examples).
Comment 8 Pierre-Charles David CLA 2017-11-08 03:37:16 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.