Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 534277 - [FilteredTree] erroneous filtering with multiple words
Summary: [FilteredTree] erroneous filtering with multiple words
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P1 major (vote)
Target Milestone: 4.8 RC2   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 203792 535047
  Show dependency tree
 
Reported: 2018-05-02 13:49 EDT by John Collier CLA
Modified: 2018-05-24 14:07 EDT (History)
9 users (show)

See Also:
mistria: review? (lbullen)
mistria: review? (loskutov)
akurtakov: review+
Lars.Vogel: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Collier CLA 2018-05-02 13:49:31 EDT
In Eclipse Photon, FilteredItemsSelectionDialog no longer appears to properly filter out items when a search string is entered.

It appears it will filter the first part of the string, but seems to ignore any later part. For example, if a dialog has the following items:
- A
- A B
- C

Entering "A B" into the filter dialog, will only filter out "C", and leave both "A" and "A B", where it should filter out "A" as well.


This seems to be possibly related to this commit here https://github.com/eclipse/eclipse.platform.ui/commit/9cb6a77fc17521ac18996c43fc2e73651a2793a7#diff-637792f9403e00bfa81e26048e1bb1c7 for Bug 531332, since this error is not seen on any version below Photon.
Comment 1 John Collier CLA 2018-05-02 13:53:17 EDT
To reproduce, do the following:
1. Create a Java project
2. Right click on the project select "New" and then "Other..."
3. In the dialog, type "JUnit Test Case".

On Oxygen.3 and below, only "JUnit Test Case" will show. On Photon, "JUnit Test Case" and "JUnit Test Suite" will both show up.
Comment 2 Andrey Loskutov CLA 2018-05-02 14:10:45 EDT
Lucas, please check this one.
Comment 3 Dani Megert CLA 2018-05-10 10:20:49 EDT
Lucas, this is a must fix for 4.8.
Comment 4 Alexander Kurtakov CLA 2018-05-16 10:58:35 EDT
IMHO this comes from bug 203792 and the 3 words are matched separately.
Comment 5 Mickael Istria CLA 2018-05-16 12:20:27 EDT
I'm trying to work on a unit test to reproduce the issue on the New Wizard.
Comment 6 Mickael Istria CLA 2018-05-16 12:44:06 EDT
(In reply to Mickael Istria from comment #5)
> I'm trying to work on a unit test to reproduce the issue on the New Wizard.

Reproducing this kind test case in Java without SWTBot or similar is quite hard, not sure I'll succeed.
In the meantime, I look a bit more at this and https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b1fd6652db198148357011db5e1a295263197519 and I'm a bit afraid of any change likely to cause regressions someplace else. Indeed, the FilteredTree is a widely used widget, but it's real behavior (aka what it does match and what it doesn't) is not really specified. As a result, it has been changed with bugs like this one, but some people may also rely on some implementation choices that are not guaranteed neither.

Anyway, I think the fix is indeed related to last comment on bug 203792: if amount N words in the search S{1..N} (like "JUnit Test Case") and M words in the value V{1..M} (like "JUnit" "Test" "Suite"), we have one of Si ("Case") that doesn't map any Vj, then we should filter out the value
Comment 7 Dani Megert CLA 2018-05-17 03:39:13 EDT
(In reply to Mickael Istria from comment #6)
> Anyway, I think the fix is indeed related to last comment on bug 203792: if
> amount N words in the search S{1..N} (like "JUnit Test Case") and M words in
> the value V{1..M} (like "JUnit" "Test" "Suite"), we have one of Si ("Case")
> that doesn't map any Vj, then we should filter out the value

Could we just revert the fix for bug 203792 for 4.8?
Comment 8 Mickael Istria CLA 2018-05-17 05:49:54 EDT
(In reply to Dani Megert from comment #7)
> (In reply to Mickael Istria from comment #6)
> > Anyway, I think the fix is indeed related to last comment on bug 203792: if
> > amount N words in the search S{1..N} (like "JUnit Test Case") and M words in
> > the value V{1..M} (like "JUnit" "Test" "Suite"), we have one of Si ("Case")
> > that doesn't map any Vj, then we should filter out the value
> 
> Could we just revert the fix for bug 203792 for 4.8?

I hope I can provide the fix suggested earlier later today.
Comment 9 Eclipse Genie CLA 2018-05-17 08:31:43 EDT
New Gerrit change created: https://git.eclipse.org/r/122869
Comment 10 Alexander Kurtakov CLA 2018-05-22 10:26:11 EDT
Dani, would you please review for RC2?
Comment 11 Dani Megert CLA 2018-05-22 12:10:47 EDT
(In reply to Alexander Kurtakov from comment #10)
> Dani, would you please review for RC2?

See my comment in the change.
Comment 13 Noopur Gupta CLA 2018-05-24 03:47:04 EDT
It causes bug 535047.
Comment 14 Kalyan Prasad Tatavarthi CLA 2018-05-24 13:30:08 EDT
(In reply to John Collier from comment #1)
> To reproduce, do the following:
> 1. Create a Java project
> 2. Right click on the project select "New" and then "Other..."
> 3. In the dialog, type "JUnit Test Case".
> 
> On Oxygen.3 and below, only "JUnit Test Case" will show. On Photon, "JUnit
> Test Case" and "JUnit Test Suite" will both show up.

I have tried the above test case but in step 3 above, I have used the string "JUnit Test C" 

On Oxyger.3 only only "JUnit Test Case" will show. On Photon, "JUnit
> Test Case" and "JUnit Test Suite" will both show up.

This bug is not fully fixed. 
This happens in both the builds 
I20180524-0900 and 
I20180523-2000

So I am reopening the bug
Comment 15 Mickael Istria CLA 2018-05-24 13:45:02 EDT
(In reply to Kalyan Prasad Tatavarthi from comment #14)
> I have tried the above test case but in step 3 above, I have used the string
> "JUnit Test C"  
> On Oxyger.3 only only "JUnit Test Case" will show. On Photon, "JUnit
> Test Case" and "JUnit Test Suite" will both show up.

The C matches "Create" in the description.
While the behavior is a bit different here and may be perceived as a small bug for this specific case, I don't think the behavior is actually a bug. The new behavior is IMO better.
And even if we can discuss whether we want this fixed or not ultimately, I don't think it's really critical enough for M3 at that point and I suggest we release Photon with it.
Comment 16 Kalyan Prasad Tatavarthi CLA 2018-05-24 13:53:15 EDT
(In reply to Mickael Istria from comment #15)
> (In reply to Kalyan Prasad Tatavarthi from comment #14)
> > I have tried the above test case but in step 3 above, I have used the string
> > "JUnit Test C"  
> > On Oxyger.3 only only "JUnit Test Case" will show. On Photon, "JUnit
> > Test Case" and "JUnit Test Suite" will both show up.
> 
> The C matches "Create" in the description.
> While the behavior is a bit different here and may be perceived as a small
> bug for this specific case, I don't think the behavior is actually a bug.
> The new behavior is IMO better.
> And even if we can discuss whether we want this fixed or not ultimately, I
> don't think it's really critical enough for M3 at that point and I suggest
> we release Photon with it.

The issue here is: Why is "JUnit Test Suite" being highlighted here? there is no C in it
Comment 17 Dani Megert CLA 2018-05-24 14:00:31 EDT
(In reply to Mickael Istria from comment #15)
> (In reply to Kalyan Prasad Tatavarthi from comment #14)
> > I have tried the above test case but in step 3 above, I have used the string
> > "JUnit Test C"  
> > On Oxyger.3 only only "JUnit Test Case" will show. On Photon, "JUnit
> > Test Case" and "JUnit Test Suite" will both show up.
> 
> The C matches "Create" in the description.
> While the behavior is a bit different here and may be perceived as a small
> bug for this specific case, I don't think the behavior is actually a bug.
> The new behavior is IMO better.

+1.
Comment 18 Kalyan Prasad Tatavarthi CLA 2018-05-24 14:07:17 EDT
verified in the build : I20180524-0900