Bug 485397 - EPackageProvider.registerPackage(EPackage) override any other EPackage with the same name
Summary: EPackageProvider.registerPackage(EPackage) override any other EPackage with t...
Status: RESOLVED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Query Language (show other bugs)
Version: 3.5.0   Edit
Hardware: All All
: P3 major
Target Milestone: ---   Edit
Assignee: Yvan Lussaud CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 483577
  Show dependency tree
 
Reported: 2016-01-08 05:11 EST by Cedric Brun CLA
Modified: 2016-05-24 05:31 EDT (History)
1 user (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 2016-01-08 05:11:15 EST
Two (or more) EPackages can have the same name. For instance in Sirius there are a number of EPackages which are named "description" but have a different nsURI.

ex : 

description  http://www.eclipse.org/sirius/diagram/sequence/description/2.0.0
description  http://www.eclipse.org/sirius/table/description/1.1.0
description  http://www.eclipse.org/sirius/diagram/description/1.1.0

These EPackages are being registered in the EPackageProvider but in the end only the last one is kept by AQL, leading to errors like "type description::SomeThing" not found whereas it has been correctly registered.


Furthermore, the test :
if (!("ecore".equals(ePackage.getName()) && !EcorePackage.eNS_URI.equals(ePackage.getNsURI()))) {

in EPackageProvider.registerPackage(EPackage) might not be needed anymore if AQL handles this case gracefully as it came from the fact that an EPackage contributed by OCL was named "ecore" and would make type literals based services fail.
Comment 1 Yvan Lussaud CLA 2016-01-08 05:24:42 EST
We should have way to warn the user when he registers two different EClasses with the same EPackage and EClass names. A EPackageRegistrationResult similar to ServiceRegistrationResult ?
Comment 2 Eclipse Genie CLA 2016-01-08 07:48:51 EST
New Gerrit change created: https://git.eclipse.org/r/63839
Comment 3 Eclipse Genie CLA 2016-01-08 08:32:13 EST
New Gerrit change created: https://git.eclipse.org/r/63845
Comment 5 Cedric Brun CLA 2016-01-19 09:14:00 EST
Fixed on master
Comment 7 Maxime Porhel CLA 2016-05-24 05:31:38 EDT
The correction made in AQL for this bugzilla has been validated on the Sirius use case through Bug 483577 homologation on Sirius 4.0.0.201605180923 (4.0.0 RC1) and AQL 5.0.0.201605040614.