Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338141

Summary: Regression in EClassImpl's getAllESuperTypes()
Product: [Modeling] EMF Reporter: Adam Neal <adamneal>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: Kenn.Hussey
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

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.