Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345733 - [JFace] TreeViewer: Add debug message to find clients that add duplicate elements
Summary: [JFace] TreeViewer: Add debug message to find clients that add duplicate elem...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 09:32 EDT by Markus Keller CLA
Modified: 2012-03-13 07:10 EDT (History)
2 users (show)

See Also:


Attachments
Fix (944 bytes, patch)
2011-05-13 09:32 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-05-13 09:32:38 EDT
Created attachment 195589 [details]
Fix

HEAD, follow-up to bug 341259 and bug 294650 comment 37

Bug 341259 added a debug flag to help finding content providers that return duplicate elements. A similar check should also be performed when items are manually added to a parent.

Bug 294650 comment 37 has a patch for this, but the patch is not good:
- adds a performance overhead to AbstractTreeViewer#internalAdd(..) even if the flag is disabled
- assertElementsNotNull(..) is badly formatted and has bad API that doesn't tell that the array can also contain TreeItems