Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364178 - Not serializable exception thrown when producing a class declaring an attribute of a refined generic type.
Summary: Not serializable exception thrown when producing a class declaring an attribu...
Status: NEW
Alias: None
Product: MMT.ATL
Classification: Modeling
Component: emfvm (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: mmt-atl.toolkit-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-18 11:37 EST by Dominique Blouin CLA
Modified: 2011-11-18 11:37 EST (History)
0 users

See Also:


Attachments
Source code of the modified class. (29.99 KB, text/x-java)
2011-11-18 11:37 EST, Dominique Blouin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.