Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320378 - Register Metamodel does not work properly on inheriting metamodels
Summary: Register Metamodel does not work properly on inheriting metamodels
Status: CLOSED FIXED
Alias: None
Product: MMT.ATL
Classification: Modeling
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: mmt-atl.toolkit-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 08:04 EDT by Vincent MAHE CLA
Modified: 2017-06-05 09:07 EDT (History)
2 users (show)

See Also:
william.piers: iplog+


Attachments
a test project with the presented failure (10.73 KB, application/zip)
2010-07-20 08:04 EDT, Vincent MAHE CLA
no flags Details
Patch to solve the problem (3.42 KB, patch)
2010-08-26 08:28 EDT, Vincent MAHE CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent MAHE CLA 2010-07-20 08:04:01 EDT
Created attachment 174733 [details]
a test project with the presented failure

For a metamodel which relies on another metamodel (ie extends AM3 metamodel), the "Register Metamodel" is not able to rely the inheriting NsURI with the NsURI of inherited metamodel (despite this one has been registered opening AM3 Megamodel Navigator).
A sample is joined for test.
Comment 1 Vincent MAHE CLA 2010-08-26 08:28:43 EDT
Created attachment 177522 [details]
Patch to solve the problem

The way to load the resource corresponding to the Ecore file was not the appropriate one.
The joined patch makes inherited metamodels linked to the registered one.
It also adds registering of sub-packages.

Rem: the current way considers only workspace files so it may rise issues when used standalone.
Comment 2 William Piers CLA 2011-05-05 09:43:42 EDT
Hello, I tested the patch but it seems that the subpackages registration isn't necessary: 
		for (EPackage subPackage : p.getESubpackages()) {
			registerPackage(subPackage);
		}

The getElementsByType already returns all packages & subpackages, so with your patch, subpackages are registered twice.

Did you encounter a special case which made you make this choice, or do you think we can remove this loop ?

Thanks in advance
Comment 3 William Piers CLA 2011-05-10 03:54:54 EDT
I applied the patch on HEAD without the lines I mentioned. Please reopen the bug if necessary.
Comment 4 Dennis Wagelaar CLA 2017-06-05 09:07:06 EDT
This was released for ATL 3.2 - closing.