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

Bug 345733

Summary: [JFace] TreeViewer: Add debug message to find clients that add duplicate elements
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: malgorzata.tomczyk, markus.kell.r
Version: 3.7   
Target Milestone: 3.8 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix none

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