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

Bug 253169

Summary: [Duplicate] Paramaterized Instance Type Name in EClass object (in ECore) causes incorrect code generation
Product: [Modeling] EMF Reporter: Ed Merks <Ed.Merks>
Component: ToolsAssignee: Ed Merks <Ed.Merks>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: davidms, Kenn.Hussey
Version: 2.4.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 250876    
Bug Blocks:    

Description Ed Merks CLA 2008-11-03 06:50:09 EST
+++ This bug was initially created as a clone of Bug #250876 +++

Build ID: M20080911-1700

Steps To Reproduce:
Using 2.4.1 of EMF...

Create an ABSTRACT, INTERFACE EClass node inside an ECore file, and name it "JComparableObject". Set the "Instance Type Name" to "Comparable<Object>".

Create another EClass node with an ESuperType of "JComparableObject" (i.e. thatt corresponds to the first created node).

Open up the corresponding genmodel and generate model code. The generation will produce incorrect code for two generated methods:

  eBaseStructuralFeatureID(int, Class<?>), and
  eDerivedStructuralFeatureID(int, Class<?>)

The offending code in each will be: 

  "if (baseClass == Comparable<Object>.class)"

The correct solution is to have the generator drop the parameterization, producing this instead:

  "if (baseClass == Comparable.class)"

which will, of course, compile.

More information:
Comment 1 Ed Merks CLA 2008-11-03 06:54:58 EST
The changes have been committed to CVS for 2.4.2.
Comment 2 Nick Boldt CLA 2009-01-08 20:27:20 EST
Fixed in EMF 2.4.2.M200812101743