Community
Participate
Working Groups
Build Identifier: 3.0 When a CDO view gets closed it fires some lifecycle events. I tried to remove an adaper from a CDO object within during the deactivation. It throws an java.lang.IllegalStateException "View closed". Altough it is unnecessary to remove adapters when a view is closing it would be nice not to throw exceptions. Reproducible: Always Steps to Reproduce: 1.Open a CDO View and add an adapter to an CDO object. 2.Add a Lifecycle listener to the view and remove the adpater during aboutToDeactivate. 3.Close the view.
[ERROR] View closed java.lang.IllegalStateException: View closed at org.eclipse.emf.internal.cdo.util.FSMUtil.adapt(FSMUtil.java:122) at org.eclipse.emf.internal.cdo.view.CDOViewImpl$ChangeSubscriptionManager.subscribe(CDOViewImpl.java:2071) at org.eclipse.emf.internal.cdo.view.CDOViewImpl$ChangeSubscriptionManager.unsubscribe(CDOViewImpl.java:1959) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.unsubscribe(CDOViewImpl.java:1637) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.handleRemoveAdapter(CDOViewImpl.java:1618) at org.eclipse.emf.internal.cdo.CDOObjectImpl$1.didRemove(CDOObjectImpl.java:449) at org.eclipse.emf.internal.cdo.CDOObjectImpl$1.didRemove(CDOObjectImpl.java:1) at org.eclipse.emf.common.util.BasicEList.remove(BasicEList.java:622) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.remove(BasicNotifierImpl.java:170) at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:466) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.remove(BasicNotifierImpl.java:163)
Moving to Net4j, see patch for Lifecycle.java
Created attachment 167623 [details] Patch for Lifecycle.java Moving the state transition down in activate() and deactivate()
Committed to HEAD
Available in 3.0 GA: http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/