|
Re: ClassCastException when deleting an object with a volatile reference [message #414452 is a reply to message #414435] |
Wed, 07 November 2007 13:57 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Torsten,
The list returned by an isMany feature must implement InternalEList and
EStructuralFeature.Setting. This can be accomplished by using the
appropriate EcoreEList subclass, or perhaps just
EcoreEList.Dynamic/UnmodifiableEList, or DelegatingEcoreEList.Dynamic.
Torsten Link wrote:
> Hello,
>
> I have a problem when my class has a volatile reference.
> When I try to delete such an object in the generated
> model editor I always got a classCastException.
>
> My definition looks like this:
> /**
> * @model volatile="true"
> * type="IValueProvider"
> * transient="true"
> * changeable="false"
> * derived="true"
> */
> public EList<IValueProvider> getValueProviderList();
>
>
> The Exception ist here.
> ....
> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
> Caused by: java.lang.ClassCastException:
> org.eclipse.emf.common.util.BasicEList
> at
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSetting(BasicEO bjectImpl.java:1554)
> at
> org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer.add(Eco reUtil.java:1661)
> at
> org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer.handleC rossReference(EcoreUtil.java:1653)
> at
> org.eclipse.emf.ecore.util.EcoreUtil$CrossReferencer.crossRe ference(EcoreUtil.java:1623)
> ....
>
>
>
> Thanks a lot
>
>
> Torsten Link
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02793 seconds