Bug 73696 - searching only works for IJavaSearchConstants.TYPE, but not CLASS or INTERFACE
Summary: searching only works for IJavaSearchConstants.TYPE, but not CLASS or INTERFACE
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-10 14:52 EDT by Carsten Pfeiffer CLA
Modified: 2004-09-27 13:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Pfeiffer CLA 2004-09-10 14:52:31 EDT
TypeDeclarationPattern's char classOrInterface is being used to create a key 
in createIndexKey(). The key for a search without specifying typename, 
packagename, enclosingname will become 
[*, /, C] 
if classOrInterface is set to IIndexConstants.CLASS_SUFFIX. 
 
Index entries of e.g. toplevel types in the default package will look like  
[S, o, m, e, T, y, p, e, /, /, /, C] 
 
Now in DiskIndex.addQueryResults(), Index.isMatch(key, word, matchRule) is 
called, which will run a CharOperation.match(pattern, word, false) (pattern 
match). 
 
This returns false, although it should be a match. CharOperation.match() is 
probably not greedy wrt the '*', i.e. the '*' doesn't include the first two 
slashes. 
 
When searching with TYPE_SUFFIX, the generated key will be null, where 
CharOperation.match() returns true.
Comment 1 Kent Johnson CLA 2004-09-13 16:13:16 EDT
The problem is that case insensitive searches need a complete lowercase 
pattern... so we need to generate a key of [*, /, c]
Comment 2 Frederic Fusier CLA 2004-09-24 07:28:30 EDT
Verified for 3.1 M2 with build I200409231635.

I've written test case which fails with 3.1 M1 and pass with 3.1 M2.
I'll release it in HEAD stream.
Comment 3 Carsten Pfeiffer CLA 2004-09-24 07:39:01 EDT
Thanks Kent and Frédéric! 
Comment 4 Frederic Fusier CLA 2004-09-27 13:18:26 EDT
you're welcome :-)

[jdt-core-internal]
Test case testTypeDeclarationBug73696 added and released in HEAD