Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 412686

Summary: NPE when removing/adding an adapter after CDO view closed
Product: [Modeling] EMF Reporter: Esteban DUGUEPEROUX <esteban.dugueperoux>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
Whiteboard:

Description Esteban DUGUEPEROUX CLA 2013-07-10 11:05:51 EDT
Since commits about https://bugs.eclipse.org/bugs/show_bug.cgi?id=400388 the Bugzilla_381395_Test fails in native. Because the following guard has been removed :

 if (viewAndState.view == null || viewAndState.view.isActive())

The initial bug of https://bugs.eclipse.org/bugs/show_bug.cgi?id=381395 was in legacy and now since use of MinimalEObject it occurs only in native.
Comment 1 Esteban DUGUEPEROUX CLA 2013-07-10 12:08:48 EDT
I have submited a fix and a update of the test as a review : https://git.eclipse.org/r/#/c/14444/
Comment 2 Esteban DUGUEPEROUX CLA 2013-08-07 03:46:16 EDT
There is yet an issue, when executing the test of the review with EMF 2.8, the test failed on adapter removal, because with EMF 2.8 i.e. before the fix of https://bugs.eclipse.org/bugs/show_bug.cgi?id=325077, in MinimalEObjectImpl$ArrayDelegatingAdapterList.setData() there is a call to eInternalContainer(); which throws a LifecycleException.
I see 2 possible fix, include the last release of MinimalEObjectImpl in the retrofix plugin or have the call to eInternalContainer(); does check if the CDOView is closed and return if it is closed instead of throwing a LifecycleException. What do you think about that?
Comment 3 Eike Stepper CLA 2013-08-07 06:33:05 EDT
I've fixed this a little differently but it should fix the problem. In test cases please don't catch exception just to call fail("...") afterwards. That doesn't expose the exception in the JUnit view.
Comment 4 Eike Stepper CLA 2013-08-07 06:34:08 EDT
commit d4e32cc5f4c52db8c180441a147dd25690d036c3
Comment 5 Eike Stepper CLA 2013-08-07 06:37:40 EDT
Port to 4.2 via bug 414563.
Comment 6 Eike Stepper CLA 2020-12-11 10:26:02 EST
Closing.
Comment 7 Eike Stepper CLA 2020-12-11 10:40:03 EST
Closing.