Bug 156340 - [search] searchAllTypeNames return nothing for empty prefix
Summary: [search] searchAllTypeNames return nothing for empty prefix
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-06 06:19 EDT by David Audel CLA
Modified: 2006-09-18 10:08 EDT (History)
0 users

See Also:


Attachments
Proposed patch (3.01 KB, patch)
2006-09-07 03:38 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 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.