Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [CDO] IllegalArgumentException and ClassCastException
[CDO] IllegalArgumentException and ClassCastException [message #125529] Mon, 09 June 2008 14:33 Go to next message
Eclipse UserFriend
Originally posted by: pelotom.gmail.com

Hi, I've encountered a few problems while using CDO, and I'm not sure if
they are a problem with my model or with CDO. I have a modeled class
called Area, which has an attribute called "type" which is an Enumerator
with literals "elliptical" and "rectangular". The first problem is that
I've specified that the "type" attribute has a default value of
"elliptical", but when I create an Area object in the CDO editor it
doesn't have this default value. The second problem is that when I try to
set a value on it, and then click elsewhere, I get an error dialog caused
by an IllegalArgumentException being thrown in the FactoryImpl:

public Type createTypeFromString(EDataType eDataType, String initialValue)
{
Type result = Type.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" +
initialValue + "' is not a valid enumerator of '" + eDataType.getName() +
"'");
return result;
}

For some reason the initialValue is null even though a default value
literal was specified.

Another problem I've seen is that when I create an Area object in the
regular EMF editor and save it as an xmi or xml resource and then try to
import it into the CDO editor, I get a ClassCastException here:

[ERROR]
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
java.lang.ClassCastException:
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
at org.eclipse.emf.internal.cdo.CDOStore.get(CDOStore.java:138)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:940)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:1)
at
org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEL ist.java:396)
at
org.eclipse.emf.common.util.DelegatingEList$EIterator.doNext (DelegatingEList.java:1075)
at
org.eclipse.emf.common.util.DelegatingEList$EIterator.next(D elegatingEList.java:1062)
at
org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.scanNext(EContentsEList.java:512)
at
org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:436)
at org.eclipse.emf.internal.cdo.util.FSMUtil$1.hasNext(FSMUtil. java:166)
at
org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:391)
at
org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:1)
at
org.eclipse.net4j.util.fsm.FiniteStateMachine.process(Finite StateMachine.java:161)
at
org.eclipse.emf.internal.cdo.CDOStateMachine.attach(CDOState Machine.java:161)
at
org.eclipse.emf.internal.cdo.CDOStore.handleContainmentAdd(C DOStore.java:572)
at org.eclipse.emf.internal.cdo.CDOStore.add(CDOStore.java:427)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:676)
at
org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:682)
at
org.eclipse.emf.common.util.DelegatingEList.addUnique(Delega tingEList.java:517)
at
org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.doAddUnique(DelegatingNotifyingListImpl.java:323)
at
org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.addUnique(DelegatingNotifyingListImpl.java:307)
at
org.eclipse.emf.common.util.DelegatingEList.add(DelegatingEL ist.java:499)
at
org.eclipse.emf.cdo.internal.ui.actions.ImportResourceAction .doRun(ImportResourceAction.java:107)
at
org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
at
org.eclipse.net4j.util.om.monitor.MonitoredJob.run(Monitored Job.java:48)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Any ideas?

Tom
Re: [CDO] IllegalArgumentException and ClassCastException [message #125547 is a reply to message #125529] Mon, 09 June 2008 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stepper.sympedia.de

Hi Tom,

Comments below...


Tom Crockett schrieb:
> Hi, I've encountered a few problems while using CDO, and I'm not sure
> if they are a problem with my model or with CDO. I have a modeled
> class called Area, which has an attribute called "type" which is an
> Enumerator with literals "elliptical" and "rectangular". The first
> problem is that I've specified that the "type" attribute has a default
> value of "elliptical", but when I create an Area object in the CDO
> editor it doesn't have this default value. The second problem is that
> when I try to set a value on it, and then click elsewhere, I get an
> error dialog caused by an IllegalArgumentException being thrown in the
> FactoryImpl:
>
> public Type createTypeFromString(EDataType eDataType, String
> initialValue) {
> Type result = Type.get(initialValue);
> if (result == null) throw new IllegalArgumentException("The value
> '" + initialValue + "' is not a valid enumerator of '" +
> eDataType.getName() + "'");
> return result;
> }
>
> For some reason the initialValue is null even though a default value
> literal was specified.
This seems to be a real bug in CDO's default value handling. Could you
please file a Bugzilla so that you can track the progress?

>
> Another problem I've seen is that when I create an Area object in the
> regular EMF editor and save it as an xmi or xml resource and then try
> to import it into the CDO editor, I get a ClassCastException here:
>
> [ERROR]
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
>
> java.lang.ClassCastException:
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
>
> at org.eclipse.emf.internal.cdo.CDOStore.get(CDOStore.java:138)
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:940)
>
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:1)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEL ist.java:396)
> at
> org.eclipse.emf.common.util.DelegatingEList$EIterator.doNext (DelegatingEList.java:1075)
>
> at
> org.eclipse.emf.common.util.DelegatingEList$EIterator.next(D elegatingEList.java:1062)
>
> at
> org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.scanNext(EContentsEList.java:512)
>
> at
> org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:436)
>
> at
> org.eclipse.emf.internal.cdo.util.FSMUtil$1.hasNext(FSMUtil. java:166)
> at
> org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:391)
>
> at
> org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:1)
>
> at
> org.eclipse.net4j.util.fsm.FiniteStateMachine.process(Finite StateMachine.java:161)
>
> at
> org.eclipse.emf.internal.cdo.CDOStateMachine.attach(CDOState Machine.java:161)
>
> at
> org.eclipse.emf.internal.cdo.CDOStore.handleContainmentAdd(C DOStore.java:572)
>
> at org.eclipse.emf.internal.cdo.CDOStore.add(CDOStore.java:427)
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:676)
>
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:682)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.addUnique(Delega tingEList.java:517)
>
> at
> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.doAddUnique(DelegatingNotifyingListImpl.java:323)
>
> at
> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.addUnique(DelegatingNotifyingListImpl.java:307)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.add(DelegatingEL ist.java:499)
> at
> org.eclipse.emf.cdo.internal.ui.actions.ImportResourceAction .doRun(ImportResourceAction.java:107)
>
> at
> org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
>
> at
> org.eclipse.net4j.util.om.monitor.MonitoredJob.run(Monitored Job.java:48)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Hmm, I'm not sure about this one. Is it possible that you create a
separate Bugzilla and attach a small zip with the plugins that I need to
reproduce this?

Cheers
/Eike
Re: [CDO] IllegalArgumentException and ClassCastException [message #125560 is a reply to message #125547] Mon, 09 June 2008 20:47 Go to previous message
Eclipse UserFriend
Originally posted by: pelotom.gmail.com

Thanks for your quick response!

I filed the following bugs:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=236313
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236314
Re: [CDO] IllegalArgumentException and ClassCastException [message #619223 is a reply to message #125529] Mon, 09 June 2008 14:59 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6487
Registered: July 2009
Senior Member
Hi Tom,

Comments below...


Tom Crockett schrieb:
> Hi, I've encountered a few problems while using CDO, and I'm not sure
> if they are a problem with my model or with CDO. I have a modeled
> class called Area, which has an attribute called "type" which is an
> Enumerator with literals "elliptical" and "rectangular". The first
> problem is that I've specified that the "type" attribute has a default
> value of "elliptical", but when I create an Area object in the CDO
> editor it doesn't have this default value. The second problem is that
> when I try to set a value on it, and then click elsewhere, I get an
> error dialog caused by an IllegalArgumentException being thrown in the
> FactoryImpl:
>
> public Type createTypeFromString(EDataType eDataType, String
> initialValue) {
> Type result = Type.get(initialValue);
> if (result == null) throw new IllegalArgumentException("The value
> '" + initialValue + "' is not a valid enumerator of '" +
> eDataType.getName() + "'");
> return result;
> }
>
> For some reason the initialValue is null even though a default value
> literal was specified.
This seems to be a real bug in CDO's default value handling. Could you
please file a Bugzilla so that you can track the progress?

>
> Another problem I've seen is that when I create an Area object in the
> regular EMF editor and save it as an xmi or xml resource and then try
> to import it into the CDO editor, I get a ClassCastException here:
>
> [ERROR]
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
>
> java.lang.ClassCastException:
> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$Containmen tUpdatingFeatureMapEntry
>
> at org.eclipse.emf.internal.cdo.CDOStore.get(CDOStore.java:138)
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:940)
>
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreFeatureMa p.delegateGet(CDOObjectImpl.java:1)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEL ist.java:396)
> at
> org.eclipse.emf.common.util.DelegatingEList$EIterator.doNext (DelegatingEList.java:1075)
>
> at
> org.eclipse.emf.common.util.DelegatingEList$EIterator.next(D elegatingEList.java:1062)
>
> at
> org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.scanNext(EContentsEList.java:512)
>
> at
> org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:436)
>
> at
> org.eclipse.emf.internal.cdo.util.FSMUtil$1.hasNext(FSMUtil. java:166)
> at
> org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:391)
>
> at
> org.eclipse.emf.internal.cdo.CDOStateMachine$AttachTransitio n.execute(CDOStateMachine.java:1)
>
> at
> org.eclipse.net4j.util.fsm.FiniteStateMachine.process(Finite StateMachine.java:161)
>
> at
> org.eclipse.emf.internal.cdo.CDOStateMachine.attach(CDOState Machine.java:161)
>
> at
> org.eclipse.emf.internal.cdo.CDOStore.handleContainmentAdd(C DOStore.java:572)
>
> at org.eclipse.emf.internal.cdo.CDOStore.add(CDOStore.java:427)
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:676)
>
> at
> org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEList.del egateAdd(CDOObjectImpl.java:682)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.addUnique(Delega tingEList.java:517)
>
> at
> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.doAddUnique(DelegatingNotifyingListImpl.java:323)
>
> at
> org.eclipse.emf.common.notify.impl.DelegatingNotifyingListIm pl.addUnique(DelegatingNotifyingListImpl.java:307)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.add(DelegatingEL ist.java:499)
> at
> org.eclipse.emf.cdo.internal.ui.actions.ImportResourceAction .doRun(ImportResourceAction.java:107)
>
> at
> org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
>
> at
> org.eclipse.net4j.util.om.monitor.MonitoredJob.run(Monitored Job.java:48)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Hmm, I'm not sure about this one. Is it possible that you create a
separate Bugzilla and attach a small zip with the plugins that I need to
reproduce this?

Cheers
/Eike


Re: [CDO] IllegalArgumentException and ClassCastException [message #619224 is a reply to message #125547] Mon, 09 June 2008 20:47 Go to previous message
Tom Crockett is currently offline Tom CrockettFriend
Messages: 54
Registered: July 2009
Member
Thanks for your quick response!

I filed the following bugs:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=236313
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236314
Previous Topic:[CDO] IllegalArgumentException and ClassCastException
Next Topic:Save resource with validation
Goto Forum:
  


Current Time: Wed Apr 01 02:46:04 GMT 2020

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

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

Back to the top