[CDO] Issue with closing view [message #1853064] |
Thu, 16 June 2022 04:56  |
Eclipse User |
|
|
|
Hi!
After I open a view, retrieve a resource and then close the view I get the following exception:
[DEBUG] Problem while deactivating View 81 [closed]
java.lang.IllegalArgumentException: The feature 'resourceSet' is not a valid feature
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEObjectImpl.java:1101)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1054)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1042)
at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.getResourceSet(CDOResourceImpl.java:298)
at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.basicSetResourceSet(CDOResourceImpl.java:1678)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourcesEList.inverseRemove(ResourceSetImpl.java:604)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.removeAll(NotifyingListImpl.java:950)
at org.eclipse.emf.internal.cdo.view.CDOViewSetImpl.remove(CDOViewSetImpl.java:234)
at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doBeforeDeactivate(CDOViewImpl.java:1584)
at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:123)
at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:184)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:254)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:244)
at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:271)
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.close(AbstractCDOView.java:3006)
I close views also in other (unrelated) parts of the code, without any problem.
This particular code retrieves the History and iterates over the CommitInfos.
Even if I add
if (!cdoResource.cdoView().isClosed()) {
cdoResource.cdoView().close();
}
it throws the exception.
What do I miss here?
Kind regards,
Ewoud
|
|
|
Re: [CDO] Issue with closing view [message #1853069 is a reply to message #1853064] |
Thu, 16 June 2022 11:12  |
Eclipse User |
|
|
|
Ewoud Werkman wrote on Thu, 16 June 2022 10:56Hi!
After I open a view, retrieve a resource and then close the view I get the following exception:
[DEBUG] Problem while deactivating View 81 [closed]
java.lang.IllegalArgumentException: The feature 'resourceSet' is not a valid feature
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEObjectImpl.java:1101)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1054)
Have a look at this method in BasicEObjectImpl:
public Object eGet(EStructuralFeature eFeature, boolean resolve, boolean coreType)
{
int featureID = eDerivedStructuralFeatureID(eFeature);
if (featureID >= 0)
{
return eGet(featureID, resolve, coreType);
}
else
{
return eOpenGet(eFeature, resolve);
}
}
I've run thousands of test cases but I did never hit a breakpoint on the call to BasicEObjectImpl.eOpenGet() and I have no idea why eDerivedStructuralFeatureID(eFeature) would return a value < 0 (probably -1). I fear you have to set a breakpoint there yourself and find it out. Or provide me with an executable test case that reproduces the problem.
|
|
|
Powered by
FUDForum. Page generated in 0.03564 seconds