Summary: | [search] <char> + * returns 'null' from SearchPattern.getMatchingRegions(String, String, int) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> | ||||||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | philippe_mulet | ||||||||
Version: | 3.5 | ||||||||||
Target Milestone: | 3.5 M6 | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Dani Megert
2009-02-13 04:25:36 EST
This problem comes from a bug in the original method: CharOperation.match(...). When case is insensitive, only the name case is lowered, not the pattern one. That means "ARRAY" matches the pattern "*rr*" (existing test in UtilTest), but "array" wrongly does not match the "*RR*" pattern... Created attachment 125627 [details]
Proposed patch
Created attachment 125632 [details]
Proposed patch+tests
It also seems that I forgot to add tests I wrote in previous patch...
(In reply to comment #1) > This problem comes from a bug in the original method: CharOperation.match(...). > When case is insensitive, only the name case is lowered, not the pattern one. > That means "ARRAY" matches the pattern "*rr*" (existing test in UtilTest), but > "array" wrongly does not match the "*RR*" pattern... > In fact this was not a problem but specified to work like this: * When not case sensitive, the pattern is assumed to already be lowercased, the * name will be lowercased character per character as comparing. So, I'll fix this only in the StringOperation class... Created attachment 125638 [details]
New proposed patch
Released for 3.5M6 in HEAD stream. When verifying this bug fix, please note that it won't be possible to reproduce the exception using any I-build as the problem has been fixed before the new functionality was present in such a build... The only build exhibiting this issue would be the N20090212-2000 build, but I'm not sure it will be available. *** Bug 264822 has been marked as a duplicate of this bug. *** Verified in HEAD. |