Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370549 - Cast shows error if one instance is of Type ecore::EObject
Summary: Cast shows error if one instance is of Type ecore::EObject
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: 1.1.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M6   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-03 08:17 EST by Benjamin Schwertfeger CLA
Modified: 2013-02-21 08:13 EST (History)
1 user (show)

See Also:
karsten.thoms: juno+


Attachments
Example with error (6.09 KB, application/zip)
2012-02-03 08:17 EST, Benjamin Schwertfeger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Schwertfeger CLA 2012-02-03 08:17:45 EST
Created attachment 210512 [details]
Example with error

If you have two Metamodels M1 and M2 with a reference in m1 to EObject, the Type in the EMF-Metamodel becomes ecore::EObject which is a emf::EObject, but not the same.

M1:
  Referencing:
    source: EObject

M2:
  CastErrror

with
«IMPORT m1»
«IMPORT m2»

«DEFINE test FOR m1::Referencing»
«((CastError)this.source).toString()»
«ENDDEFINE»

shows the error at the cast.

ecore::EObject should look like emf::EObject in this situation.
Comment 1 Karsten Thoms CLA 2012-02-03 08:26:07 EST
EClassType needed to treat the special case, when the EClassType represents ecore::EObject itself. In this case any EClassType must be assignable.

Overridden EClassType#internalIsAssignableFrom()
Added unit test EmfMetaModelTest#testIsAssignableFrom()
Comment 2 Karsten Thoms CLA 2013-02-21 08:13:49 EST
Bug resolved before Xpand 1.2 release date => Closing