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

Bug 364178

Summary: Not serializable exception thrown when producing a class declaring an attribute of a refined generic type.
Product: [Modeling] MMT.ATL Reporter: Dominique Blouin <dominique.blouin>
Component: emfvmAssignee: mmt-atl.toolkit-inbox <mmt-atl.toolkit-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Source code of the modified class. none

Description Dominique Blouin CLA 2011-11-18 11:37:01 EST
Created attachment 207231 [details]
Source code of the modified class.

I have an Ecore class A declaring an attribute whose type is declared as a class generic parameter. Class B extends class A and refines the type of the attribute to a specific data type. E.g.:

public class A<U extends Object>
   protected U unit;

public class B extends A<EEnumX>

where EEnumx is a specific Ecore enumeration declared in the meta-model.

Problem: A not serializable exception in thrown when producing an instance of class A because the proper type of the attribute (EEnumX) is not retrieved properly.

Fix: To fix this, I have redefined EMFModelAdapter.getType() so that if the attribute declares a generic type, the proper type is returned. I attach the modified EMFModelAdapter class.

A similar problem occurs with the Regular VM.