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

Bug 355184

Summary: EObjectValidator does not support multiple inheritance validation
Product: [Modeling] EMF Reporter: Ed Willink <ed>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: knut.wannheden
Version: 2.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2011-08-19 01:19:54 EDT
In

EObjectValidator.validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context)

the recursion (for non-EcorePackage) to superclass is via

                validate(eSuperTypes.get(0), eObject, diagnostics, context);

rather than a loop over all eSuperTypes, so constraints inherited from a second supertype are ignored.

Is this deliberate or an oversight? It's certainly a convenient way of avoiding double validation of a constraint
inherited from more than one superclass.
Comment 1 Ed Merks CLA 2018-02-09 09:09:29 EST
Yes this is deliberate limitation to avoid multiple .  It's similar to the limitation in 

org.eclipse.emf.ecore.impl.EFactoryImpl.create(EClass)

which can also only create an instance of one specific concrete class.