Community
Participate
Working Groups
There are two bugs in StringMatcher. match(...) should match the whole string. find(...) can find any occurrence. A pattern of "" should only match the empty string. For example: new StringMatcher("ab", false, false).match("abz") is false, so new StringMatcher("", false, false).match("z") should be false too, but it's currently true. This is due to the segCount == 0 test, which should check whether there are actually wildcards before returning true. The next two tests check for empty target and empty pattern, but they're not currently reached. I also noticed another bug, where if ignoreWildcards is true, it doesn't check the length. So new StringMatcher("a", false, true).match("ab") currently returns true, but it should return false. The corrected lines are: if (fIgnoreWildCards) return (end - start == fLength) && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); int segCount = fSegments.length; if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern contains only '*'(s) return true; NOTES: NE (9/28/01 12:16:59 PM) See also 1GKQ0XA: ITPJUI:WINNT - Text search for 'ß' gives results for 's' Should add test case for: "uß".toUpperCase() -> "USS" Another example, from http://www.unicode.org/Public/UNIDATA/CaseFolding.txt "MASSE" and "Maße" See http://www.unicode.org/unicode/reports/tr21/ for discussion on case mappings. NE (10/2/01 2:24:13 PM) Fixed in > 202a, for StringMatcher in org.eclipse.ui.views.navigator.
PRODUCT VERSION: 117
Fixed in >202a