Bug 174720

Summary: [Navigator] a possible bug in "org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/StringMatcher.java"
Product: [Eclipse Project] Platform Reporter: Lingxiao Jiang <skyhover.pi>
Component: UIAssignee: Francis Upton IV <francisu>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: bpasero, steve.shelley
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Lingxiao Jiang CLA 2007-02-19 21:22:59 EST
Build ID: source from HEAD (checked out on 01/08/07)

Steps To Reproduce:
If take a look at line 232 in file org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/StringMatcher.java, the "for" loop has a check "tCurPos <= bound" which may be inappropriate when "segCount" is greater than 1: because "bound = end - fBound" (line 209) and "fBound" is the sum of all segments of string patterns, "bound" may be too small and cause the "for" loop to terminate too early.

Suggested fix: remove "tCurPos <= bound" from the loop condition, or add "fSegments[i].length" to "bound" at the end of each iteration. (The latter is better w.r.t. performance.)

More information:
The problem was noticed when we examined similar code in the following files:
org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/StringMatcher.java LINE:232
org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/StringMatcher.java LINE:255
org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/StringMatcher.java LINE:235
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:14:45 EDT
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.