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

Bug 340588

Summary: Least common supertype
Product: z_Archived Reporter: Nicolas Bros <nicolas.bros>
Component: EMF-FacetAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emft.facet-inbox, gdupe
Version: unspecifiedFlags: nicolas.bros: indigo+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Nicolas Bros CLA 2011-03-21 13:03:05 EDT
We need a method in EMF Facet to compute the least common supertype of a set of metaclasses. That is, the most derived  type that is a supertype of all the given classes.

This is needed in order to apply the "visible" customization on the most precise type of all the model elements in a column of the table.
Comment 1 Nicolas Bros CLA 2011-03-21 13:24:56 EDT
Committed in revision 443:
org.eclipse.emf.facet.util.emf.core.internal.EMFUtils
and tests in:
org.eclipse.emf.facet.util.emf.core.tests.UtilEMFCoreTests
Comment 2 Gregoire Dupe CLA 2011-03-23 08:57:25 EDT
Hi,

The warning in the class org.eclipse.emf.facet.util.emf.core.internal.EMFUtils has to be fixed.

Regards,
Gregoire Dupe
Comment 3 Nicolas Bros CLA 2011-03-23 11:27:00 EDT
I fixed the warning.
Comment 4 Gregoire Dupe CLA 2011-03-30 04:37:34 EDT
Hello,

A least, two tests are missing :
 - check that when no common super type exists, EObject is returned ;
 - check that the method work properly with more than one metamodel.

Regards,
Gregoire
Comment 5 Nicolas Bros CLA 2011-04-04 12:00:11 EDT
I added tests in revision 492, and changed the implementation to return the EObject EClass instead of null.
Comment 6 Gregoire Dupe CLA 2011-06-08 10:18:34 EDT
This bug can be closed.