Derived Features and delete command [message #648271] |
Wed, 12 January 2011 08:42 |
Yves Bontemps Messages: 14 Registered: March 2010 |
Junior Member |
|
|
Hi,
My model has a derived feature (say ClassA::allObjects) that must return the union of several many-valued EReferences.
I implemented this derived feature by providing code in ClassAImpl#getAllObjects() . The code simply builds a BasicEList with the union of the other references and returns that EList. According to EObject.eGet, that's what is expected.
However, when a DeleteCommand is run on an instance of ClassA, a cross-referencer finds all usages of ClassA and goes through BasicEObjectImpl.eSetting which does:
if (eFeature.isMany())
{
return (EStructuralFeature.Setting)eGet(eFeature, false);
}
and triggers a ClassCastException (BasicEList is not an instance of EStructuralFeature.Setting.
How should I then implement my derived feature properly to avoid that error ?
Furthermore, if eGet is expected to return Settings instead of EList of the type of the feature, shouldn't that be properly specified on EObject ?
Thank you,
Yves.
Cheers,
Yves.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03517 seconds