Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 201064

Summary: [search] SearchEngine.searchAllTypeNames(..) does not find CamelCase match
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.4   
Target Milestone: 3.4 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 190437    
Attachments:
Description Flags
Proposed patch none

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.