Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338141 - Regression in EClassImpl's getAllESuperTypes()
Summary: Regression in EClassImpl's getAllESuperTypes()
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.6.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-24 14:09 EST by Adam Neal CLA
Modified: 2011-02-24 14:46 EST (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 Adam Neal CLA 2011-02-24 14:09:47 EST
Build Identifier: M20110204-1030

Using the UML EMF model, there is code in GMF that tests that some UML Element's EClass has a super type of EObject.

e.g. 
EClass type = <EObject EClass>
EClass newType = <Some UML Element Eclass>

The expression:
type.isSuperTypeOf(newClass)

Should return true, and did in IES 3.4 using org.eclipse.emf.ecore_2.4.2.v200902171115

However, somewhere along the line, something changed such that the above expression now returns false.
e.g. IES 3.6.2 using org.eclipse.emf.ecore_2.6.1.v20100914-1218

This is because newClass.getEAllSuperTypes() now returns the list of super EClasses, stopping at EModelElement.  The EObject EClass is no longer returned in the list of super types as it was in the previous version.

This bug has become very obvious during import operations where the EObjectUtil.metamorphoses(...) API is used.



Reproducible: Always

Steps to Reproduce:
Call getAllESuperTypes on an EClass object.  E.g. in a debug session, open the Display View and inspect:
org.eclipse.uml2.uml.UMLPackage.Literals.NAMED_ELEMENT.getEAllSuperTypes()

The result is the following (note EObject is not included):
[org.eclipse.emf.ecore.impl.EClassImpl@17081708 (name: EModelElement) (instanceClassName: null) (abstract: true, interface: false), org.eclipse.emf.ecore.impl.EClassImpl@7b547b54 (name: Element) (instanceClassName: null) (abstract: true, interface: false)]
Comment 1 Ed Merks CLA 2011-02-24 14:46:02 EST
The explicit inheritance of EModelElement from EObject was eliminated as part of 255469. You'll need to accommodate that change, i.e., just assume that all objects are instances of EObject.