Bug 156340

Summary: [search] searchAllTypeNames return nothing for empty prefix
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.3 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description David Audel CLA 2006-09-06 06:19:29 EDT
The searchAllTypeName request for an empty prefix return nothing. It should return all types.

new SearchEngine().searchAllTypeNames(
   null,
   R_EXACT_MATCH,
   "".toChararray(),
   R_PREFIX_MATCH,
   R_TYPE,
   scope,
   nameRequestor,
   CANCEL_IF_NOT_READY_TO_SEARCH,
   null);

As type match rule is R_PREFIX_MATCH the empty string is a valid prefix for all types.


I have a workaround for this problem. I can replace the empty string by 'null'.
Comment 1 Frederic Fusier CLA 2006-09-07 03:38:58 EDT
Created attachment 49585 [details]
Proposed patch

Remove optimization at the beginning of searchAllTypeNames which stopped the search when package name was null (or empty) and type name empty. This was obviously wrong for prefix and camel case patterns...
I assume there won't be any performance impact as it concerns only a few cases of all type names search.
Comment 2 Frederic Fusier CLA 2006-09-07 03:39:30 EDT
Released for 3.3 M2 in HEAD stream.
Comment 3 David Audel CLA 2006-09-18 10:08:24 EDT
Verified for 3.3 M2 using build I20060918-0010.