Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323805 - [Viewers] PatternFilter does not search in all duplicates tree objects
Summary: [Viewers] PatternFilter does not search in all duplicates tree objects
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Hitesh CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 06:47 EDT by Said Taaouati CLA
Modified: 2010-09-07 04:40 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Taaouati CLA 2010-08-27 06:47:37 EDT
Build Identifier: Version: 3.5.1 Build id: M20090917-0800

In the case that a tree consists of two duplicates tree objects, only the first one will be processed. With duplicates objects I means the same object can be found in the tree in more then one distinct path.

The problem is found in the method:
PatternFilter.isAnyVisible(Viewer viewer, Object parent, Object[]elements)
…
    	Boolean foundAny = (Boolean) foundAnyCache.get(parent);

If parent already found in the tree, then it will be not processed again if the same object will be found in the other tree path.
    
…
 


Reproducible: Always

Steps to Reproduce:
1.Add PatternFilter  to a viewer
2.add an object twice to the tree with distinct children 
3.search for a child name in the second object. The child will be not found
Comment 1 Hitesh CLA 2010-09-01 08:10:10 EDT
I assume you are using a FilteredTree; this limitation is because we cache the already filtered results. The existing behaviour is a very common use-case; and what you see is an optimization. I do not intend to change this ATM.

It is possible for you to work around this limitation 

1) By sublclassing FilteredTree (see method protected TreeViewer doCreateTreeViewer(Composite parent, int style))

2) Adding your own filter along the lines of PatternFilter
Comment 2 Hitesh CLA 2010-09-07 04:40:05 EDT
Closing the bug as WONTFIX; read Comment 1.