Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355915 - [Legacy] Adapter notified with CDOLegacyAdapter
Summary: [Legacy] Adapter notified with CDOLegacyAdapter
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.legacy (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Fluegge CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-26 03:01 EDT by Esteban DUGUEPEROUX CLA
Modified: 2012-09-21 07:18 EDT (History)
1 user (show)

See Also:
stepper: review+


Attachments
Test v1 (4.03 KB, patch)
2011-08-26 04:27 EDT, Martin Fluegge CLA
no flags Details | Diff
Patch v1 (1.59 KB, patch)
2011-08-26 04:29 EDT, Martin Fluegge CLA
no flags Details | Diff
Test+Fix v2 (14.64 KB, patch)
2011-08-29 06:53 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.