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

Bug 355915

Summary: [Legacy] Adapter notified with CDOLegacyAdapter
Product: [Modeling] EMF Reporter: Esteban DUGUEPEROUX <esteban.dugueperoux>
Component: cdo.legacyAssignee: Martin Fluegge <martin.fluegge>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: stepper
Version: 4.1Flags: stepper: review+
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Test v1
none
Patch v1
none
Test+Fix v2 none

Description Esteban DUGUEPEROUX CLA 2011-08-26 03:01:17 EDT
Build Identifier: CDO 4.0.1 & 4.1

Having a Adapter added on a EObject contained in a CDOResource, changes on this EObject send notifications to the adapter with a CDOLegacyAdapter wrapping this EObject as notifier, while the notifier should be the wrapped EObject.

It should be have the same issue when having a ResourceSetListenerImpl listening  Notifications.

See http://www.eclipse.org/forums/index.php/t/236411/ for more details

Reproducible: Always
Comment 1 Martin Fluegge CLA 2011-08-26 04:27:45 EDT
Created attachment 202213 [details]
Test v1

I rewrote the test provided by Esteban in his post (http://www.eclipse.org/forums/index.php/m/718239/), because I had some issue with the threading on my machine. The test demonstrates the problem.
Comment 2 Martin Fluegge CLA 2011-08-26 04:29:46 EDT
Created attachment 202214 [details]
Patch v1

The problem from the CDOView which passed the dirty (or detached) CDOObject to the CDOInvalidationNotificationImpl. In the case of legacy this must be the internal instance, otherwise the wrapper will be set as notifier. Patch v1 fixes this problem.
Comment 3 Martin Fluegge CLA 2011-08-26 04:32:20 EDT
I believe this problem can be easily fixed on CDO 4.0. I've currently some issues with my maintenance workspace. As soon as this problem is solved I
I'll provide a patch.
Comment 4 Eike Stepper CLA 2011-08-29 06:53:21 EDT
Created attachment 202307 [details]
Test+Fix v2

I've moved the CDOObject->EObject conversion into CDOInvalidationNotification.
Then I've added a second test case to show that CDODeltaNotification suffers from the same problem.
I've fixed it there, too.

Now it can be backported ;-)
Comment 5 Martin Fluegge CLA 2011-08-31 04:01:23 EDT
Committed revision 8996
Comment 6 Eike Stepper CLA 2012-09-21 07:18:08 EDT
Closing.