Community
Participate
Working Groups
HEAD org.eclipse.ui.dialogs.SearchPattern as a few painful glitches that need to be corrected ASAP, since they cause subtle problems in the Open Type dialog. I'll attach a fix for these problems: - calls String#trim() when only last character should be deleted - should detect string ending in " " or "<" as RULE_EXACT_MATCH, not RULE_CAMELCASE_MATCH - isValidCamelCaseChar(..) always returns true To reproduce the problems of the blocked bugs, you usually have to type very quickly (or paste the whole pattern).
Created attachment 65376 [details] Fix
Krzysztof please test this against the bugs Markus has outlined on the fastest machine you have
This bug is result of enhancement described in bug#174349. Tod, Markus, if it necessary we could rollback all our changes.
That brings us again knee-deep into the problems of bug 176017. The fix for bug 174349 only seems to work in the ui.dialogs.SearchPattern but not in the jdt.core version. This can be seen with the following scenarios: a) type "HM", wait for the search to finish, and the append a "<" => looks like bug 174349 is fixed (since ui.dialogs.SearchPattern refilters the matches for HM) b) new Open Type dialog, paste "HM<" => no matches (since jdt.core's SearchPattern does not support that pattern) I'm not sure what else the "fix" for bug 174349 and later changes changed in SearchPattern, so it's hard to tell for me whether reverting is better than just releasing my fix. The calls to String#trim() need to be removed even if you decide to revert.
Created attachment 66138 [details] Patch rollback all inconvenient changes I reverted all incorrect enhancements described in bug 174349. Moreover inside patch i attached changes to SearchPatern test cases. Markus could you test it and give us a feedback.
Created attachment 66263 [details] Rollback + fixed usages of String#trim() The "rollback" patch fixes most problems, but still leaves the wrong calls to String#trim() where only the last character should be removed. It's e.g. strange that " ArrayList " finds matches, but " ArrayList" does not. Here's my (final?) patch based on Krzysztof's rollback, with the trim() problems fixed in initializePatternAndMatchRule(..). Krzysztof, please review again.
Created attachment 66269 [details] Patch to SearchPattern test cases I reviewed Markus corrections. Everything looks good. Moreover i attached patch to test cases.
> Moreover i attached patch to test cases. Oops, I'm sorry. Forgot that I skipped the tests because I didn't have the in my workspace.
+1 from me. I'll need a second committer to commit this - Szymon would you check please?
There are wrong docs for methods in SearchPatternAuto class. Look at testExactMatch1 and testExactMatch2. Strings from comments "abcd" are different than these used in test. You made some typos in docs too, like "funtionality". Otherwise looks good.
Created attachment 66455 [details] Patch is respone for Szymon comment. Patch contains fixes for SearchPattern and SearchPatternAuto.
+1 from me
Krzysztof please make the updates Szymon suggests and then we can re-review
+1 from me for the latest patch.
Patch released to HEAD for build >20070416