Bug 32339 - Cannot find declaration of SIGNATURE in Java text search
Summary: Cannot find declaration of SIGNATURE in Java text search
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-20 07:02 EST by Philipe Mulet CLA
Modified: 2003-03-11 06:03 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-02-20 07:02:56 EST
Build 20030218

When using Java text search with pattern 'SIGNATURE' in case INsensitive mode 
and working set 'jdtcore', it will not find exact case match in IIndexConstants.
Comment 1 Jerome Lanneluc CLA 2003-02-20 09:29:19 EST
Problem is in IndexSummary.getFirstBlockLocationForPrefix(char[], boolean).
In case insensitive mode, it should not stop on the first block it finds, but 
it should look for all possible blocks.

For example, if you have the following blocks:
- AA
  +- Aa
  +- Ab
- aa
  + aA
  + ab
and you search for 'ab' in case insentitive mode, it will only search in block 
AA.
Comment 2 Philipe Mulet CLA 2003-02-20 09:35:23 EST
Indeed, in case sensitive mode, it behaves ok. In case insensitive mode, 
multiple blocks could match the pattern, and a dichotomic search may only find 
one of them (somewhat random).

In case insensitive mode, it should iterate over the entire summary on detect 
all starting blocks, then walk them all.
Comment 3 Kent Johnson CLA 2003-02-20 18:02:23 EST
Put the old code back which first finds all matching entries of the same kind, 
then does the case insensitive match with the entered name.

With the way the blocks are stored in the index its not possible to search them 
affectively using a case insensitive comparison. The blocks are ordered:

aaa
aab
abb
baa
bab
...
zzz
Aaa
...
Comment 4 Jerome Lanneluc CLA 2003-02-21 05:07:45 EST
Just curious: do you remember why the new code was introduced in the first 
place? Was this for optimization?
Comment 5 Philipe Mulet CLA 2003-02-22 04:45:09 EST
Ok, in case insensitive mode the only prefix used is case sensitive 
(/methodRef). Will walk more entries, but this is the old behavior and our 
index encoding doesn't allow much more at this point.
Comment 6 David Audel CLA 2003-03-11 06:03:49 EST
Verified.