Community
Participate
Working Groups
CDOObejctImpl re-implements the method eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID, NotificationChain msgs) from BasicEObjectImpl, but it breaks when the resource is not a CDOResource. It starts with: boolean isResourceRoot = this instanceof CDOResource && ((CDOResource)this).isRoot(); and then if this is not a CDOResource, it won't be root and this cause the following code to act incorrectly: boolean moved = oldView != null && oldView == newView; if (!moved && oldResource != null && oldResource != newResource && !isResourceRoot) { oldResource.detached(this); } compared to the original: if (oldResource != newResource && oldResource != null) { oldResource.detached(this); } the solution that we applied is to call super when not dealing with a CDOResource: if (!(this instanceof CDOResource)) { return super.eBasicSetContainer(newContainer, newContainerFeatureID, msgs); } boolean isResourceRoot = ((CDOResource)this).isRoot(); and voila, problem solved.
Moving all open bugzillas to 4.5.
Hi Alain, Could you give more details about the problematic use case this code affect? With a JUnit test case for example.
Estaban, I don't have a unit test for it, but the problem occurs when your EObject inherits from CDOObject, like ours do, but you are dealing with a non CDO repository (i.e. a standard EMF XMI repository). This is a pattern that works very well, but in this case there was a small glitch with this scenario. HTH Alain
Moving all unaddressed bugzillas to 4.6.
Moving all open bugs to 4.7
Moving all unresolved issues to version 4.8-
Moving all unresolved issues to version 4.9
Moving to 4.13.