[CDO] CDOStaleReferencePolicy & EMap [message #1856049] |
Thu, 17 November 2022 00:45  |
Eclipse User |
|
|
|
I am getting a ClassCastException:
java.lang.Class Cast Exception: class org.eclipse.emf.ecore.util.Basic Internal EList cannot be cast to class org.eclipse.emf.common.util.EMap (org.eclipse.emf.ecore.util.Basic Internal EList is in unnamed module of loader org.eclipse.osgi.internal.loader.Equinox Class Loader @644dfab9; org.eclipse.emf.common.util.EMap is in unnamed module of loader org.eclipse.osgi.internal.loader.Equinox Class Loader @7ef46d85)
at com.sun.proxy.$Proxy154.getExternalIds(Unknown Source)
at com.castortech.iris.ba.security.provider.access.ExternalElementAccessControllerImpl.isExternalElement(ExternalElementAccessControllerImpl.java:248)
Looking at CDOStaleReferencePolicy (ours and current, no real change), it appears that a isMany feature will be handled as a basicEList and never as an eMap.
Am I missing something here?
Cheers,
Alain
|
|
|
|
Re: [CDO] CDOStaleReferencePolicy & EMap [message #1856093 is a reply to message #1856057] |
Mon, 21 November 2022 04:58   |
Eclipse User |
|
|
|
Eike,
I added the block that you suggested and also to be sure:
if (featureParam.isMany())
{
if (type.getInstanceClassName() == "java.util.Map$Entry") //$NON-NLS-1$
{
return new BasicEMap<Object, Object>();
}
return new BasicInternalEList<Object>(Object.class);
}
As you said, stale references are meant to handle a narrow use case, so reproduction is not that easy to come by.
But in that vein, we've had for many years some scattered code to look for stale references, but that doesn't seem to be the right approach, as its like a game of whack a mole. Been looking at finding a more generic solution to filter those out, maybe as part of our own base EObject eGet, but I don't seem to have found the right solution to handle many references without forcing a full load from the iterator or else I feel that we might go to deep to address this. Your thoughts?
Cheers,
Alain
|
|
|
|
Powered by
FUDForum. Page generated in 0.03717 seconds