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

Bug 327326

Summary: [DataBinding] Equality check on decorated lists
Product: [Eclipse Project] Platform Reporter: Thomas Schindl <tom.schindl>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: stalebug
Attachments:
Description Flags
Patch none

Description Thomas Schindl CLA 2010-10-08 07:07:35 EDT
Looking at the code of DecoratingObservableCollection I wonder why the equals() does not check o == this before delegating the equal check to the decorated list.

In standard cases this is not a problem because the equals-contract of Collections defines that they are equal if they holds the same element-instances but an exception to this rule is that under certain circumstances this contract is violated with intenions (e.g. when using Teneo+Hibernate) because there a equals check like this would lead to fetch all content from the list to make the equality check.

I've been debugging a TreeViewer#refresh() problem which uses such an IObservableList as input now for multiple hours and though adding this check would not solve all corner cases it would at least fix this problem very problem.
Comment 1 Matthew Hall CLA 2010-10-12 23:39:54 EDT
Created attachment 180721 [details]
Patch

Tom, does this help?
Comment 2 Thomas Schindl CLA 2010-10-27 02:36:19 EDT
Ahm, looking at your patch the required check (if (this == obj)) is already there so it looks like things should work with current M-builds already. I'll try to check if the latest M-build is working and if it does we can close this one as WORKSFORME.
Comment 3 Matthew Hall CLA 2011-09-14 01:23:07 EDT
Tom, is this still an issue?
Comment 4 Lars Vogel CLA 2019-11-14 03:35:30 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.