Hi,
I have somehow managed to introduce a stale reference into CDO although the CDO repository is configured to ensure referential integrity. I think this has happend before and I will investigate on this and maybe report on it in a different thread. In any case. If this happens I encounter the following exception when trying to attach an ECrossReferenceAdapter to the model:
java.lang.ClassCastException: org.eclipse.emf.common.util.BasicEList cannot be cast to org.eclipse.emf.ecore.util.InternalEList
at org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer.getCrossReferences(ECrossReferenceAdapter.java:105)
at
This happens in the course of loading a papyrus ModelSet where I have to point out that the stale reference is not related to Papyrus or UML.
Apart from the ECrossReferenceAdapter which I know should not be facilitated when using CDO I also get an exception when trying to attach a TransactionChangeRecorder:
java.lang.ClassCastException: org.eclipse.emf.common.util.BasicEList cannot be cast to org.eclipse.emf.ecore.util.InternalEList
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.setTarget(TransactionChangeRecorder.java:146)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.didAdd(BasicNotifierImpl.java:121)
The bad thing is, that this exception completely prevents me from loading the model.
The object which causes the exception is:
CDOStaleReferencePolicy$DynamicProxy
The cast which is performed in the later case is:
((InternalEList<EObject>) ((EObject) target).eContents())
This results in the following return statement in the DynamicProxy:
if (List.class.isAssignableFrom(returnType))
{
return new BasicEList<Object>();
}
Thus a basicEList is returned although in a couple of cases an InternalEList is excepted. I think the case of eContent and other related method must be handled separately in the policy.
Any thougths on this?
Regards
Thorsten