Bug 201064 - [search] SearchEngine.searchAllTypeNames(..) does not find CamelCase match
Summary: [search] SearchEngine.searchAllTypeNames(..) does not find CamelCase match
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 190437
  Show dependency tree
 
Reported: 2007-08-24 06:47 EDT by Markus Keller CLA
Modified: 2007-09-18 03:22 EDT (History)
0 users

See Also:


Attachments
Proposed patch (8.70 KB, patch)
2007-08-24 09:50 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-08-24 06:47:41 EDT
HEAD

SearchEngine.searchAllTypeNames(..) does not find R_CAMEL_CASE_MATCH match without  R_PREFIX_MATCH when I search with pattern "HMap". It should find java.util.HashMap.

I think the problem is in Index 1.28, line 62:
You need to extract the type name from the word. This was not necessary with the old R_CAMELCASE_MATCH, since that one was always a prefix match.

To reproduce, apply the patch from bug 190437, open the Open Type dialog, and paste (don't type!) "HMap<".
Comment 1 Markus Keller CLA 2007-08-24 08:42:26 EDT
Fix could be to remove 2 lines from TypeDeclarationPattern:

268	if (this.isCamelCase) break; // camel case doesn't imply prefix
296	matchRule &= ~R_EXACT_MATCH; // no-op
Comment 2 Markus Keller CLA 2007-08-24 08:53:18 EDT
(In reply to comment #1)
Nope, would break "H<".
Comment 3 Frederic Fusier CLA 2007-08-24 09:50:28 EDT
Created attachment 76897 [details]
Proposed patch
Comment 4 Frederic Fusier CLA 2007-08-24 09:50:56 EDT
Released for 3.4M2 in HEAD stream.
Comment 5 Eric Jodet CLA 2007-09-18 00:58:57 EDT
Verified for 3.4 M2 using build I20070917-0010.