Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Dynamic classes are mapped as static/generated
[Teneo] Dynamic classes are mapped as static/generated [message #86625] Sun, 17 June 2007 12:51 Go to next message
Eclipse UserFriend
I was unable to find EMFT category in bugzilla so I am posting this here.

Detection whether model class is dynamic or static is broken with latest
Teneo CVS and EMF 2.3. Dynamic classes get <class
name="org.eclipse.emf.ecore.impl.DynamicEObjectImpl" ... > mapping,
which fails.

MappingContext#isDynamic is set to false for dynamic classes.
ERuntime#computeConcreteInstanceMapping detects that instance was
created and takes that as evidence that class is dynamic. But this just
puts DynamicEObjectImpl in eclassifierToConcrete map. My quick fix below
was to check getInstanceClass() as well

for (EClassifier eclassifier : epack.getEClassifiers()) {
if (!(eclassifier instanceof EClass))
continue;
// BEGIN FIX
if(eclassifier.getInstanceClass() == null)
continue;
// END FIX
final Object instance = create((EClass)eclassifier);
if (instance != null) {
eclassifierToConcrete.put((EClass) eclassifier, instance
.getClass());
concreteToEClass.put(instance.getClass(),
(EClass) eclassifier);
}


I

-a
Re: [Teneo] Dynamic classes are mapped as static/generated [message #86639 is a reply to message #86625] Sun, 17 June 2007 23:22 Go to previous message
Eclipse UserFriend
Thanks for reporting this, this is bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193052

Btw, here is a direct hyperlink to create an emft bugzilla (select teneo in the component listbox):
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT

gr. Martin

Aleksander Bandelj wrote:
> I was unable to find EMFT category in bugzilla so I am posting this here.
>
> Detection whether model class is dynamic or static is broken with latest
> Teneo CVS and EMF 2.3. Dynamic classes get <class
> name="org.eclipse.emf.ecore.impl.DynamicEObjectImpl" ... > mapping,
> which fails.
>
> MappingContext#isDynamic is set to false for dynamic classes.
> ERuntime#computeConcreteInstanceMapping detects that instance was
> created and takes that as evidence that class is dynamic. But this just
> puts DynamicEObjectImpl in eclassifierToConcrete map. My quick fix below
> was to check getInstanceClass() as well
>
> for (EClassifier eclassifier : epack.getEClassifiers()) {
> if (!(eclassifier instanceof EClass))
> continue;
> // BEGIN FIX
> if(eclassifier.getInstanceClass() == null)
> continue;
> // END FIX
> final Object instance = create((EClass)eclassifier);
> if (instance != null) {
> eclassifierToConcrete.put((EClass) eclassifier, instance
> .getClass());
> concreteToEClass.put(instance.getClass(),
> (EClass) eclassifier);
> }
>
> I
>
> -a


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Dynamic classes are mapped as static/generated [message #607003 is a reply to message #86625] Sun, 17 June 2007 23:22 Go to previous message
Eclipse UserFriend
Thanks for reporting this, this is bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=193052

Btw, here is a direct hyperlink to create an emft bugzilla (select teneo in the component listbox):
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT

gr. Martin

Aleksander Bandelj wrote:
> I was unable to find EMFT category in bugzilla so I am posting this here.
>
> Detection whether model class is dynamic or static is broken with latest
> Teneo CVS and EMF 2.3. Dynamic classes get <class
> name="org.eclipse.emf.ecore.impl.DynamicEObjectImpl" ... > mapping,
> which fails.
>
> MappingContext#isDynamic is set to false for dynamic classes.
> ERuntime#computeConcreteInstanceMapping detects that instance was
> created and takes that as evidence that class is dynamic. But this just
> puts DynamicEObjectImpl in eclassifierToConcrete map. My quick fix below
> was to check getInstanceClass() as well
>
> for (EClassifier eclassifier : epack.getEClassifiers()) {
> if (!(eclassifier instanceof EClass))
> continue;
> // BEGIN FIX
> if(eclassifier.getInstanceClass() == null)
> continue;
> // END FIX
> final Object instance = create((EClass)eclassifier);
> if (instance != null) {
> eclassifierToConcrete.put((EClass) eclassifier, instance
> .getClass());
> concreteToEClass.put(instance.getClass(),
> (EClass) eclassifier);
> }
>
> I
>
> -a


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[Teneo] Dynamic classes are mapped as static/generated
Next Topic:[Teneo] : VersionPropertyHandler returns null for dettached objects
Goto Forum:
  


Current Time: Wed Jul 02 16:47:36 EDT 2025

Powered by FUDForum. Page generated in 0.05570 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top