Bug 40116 - Search for references to nested class doesn't find anything
Summary: Search for references to nested class doesn't find anything
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-15 11:30 EDT by Felix L J Mayer CLA
Modified: 2003-08-28 04:46 EDT (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 Felix L J Mayer CLA 2003-07-15 11:30:27 EDT
Via right-click in the Outline view, I searched for references to the class 
HashKey and its constructor. This class is nested within 
org.eclipse.draw2d.AutomaticRouter. I used the search scope Workspace.

The search results came up empty for both searches (class and constructor), 
even though HashKey is referenced many times within the AutomaticRouter.
I assume that something is wrong with the search algorithm.
Comment 1 Philipe Mulet CLA 2003-07-16 05:46:33 EDT
Where is org.eclipse.draw2d.AutomaticRouter defined ?
Comment 2 Felix L J Mayer CLA 2003-07-16 09:39:43 EDT
It is in the Draw2D part of the GEF (Graphical Editor Framework).
Comment 3 Jerome Lanneluc CLA 2003-07-17 06:16:07 EDT
When indexing AutomaticRouter.class, BinaryIndexer doesn't add a typeRef to 
HashKey, but to AutomaticRouter$HashKey.

I think we should have both: a typeRef to HashKey and a typeRef to 
AutomaticRouter$HashKey (it could be a ref to a top-level class). 

The drawback is that we're going to increase the size of the index even if the 
latter almost never happens.

Kent, what do you think?
Comment 4 Kent Johnson CLA 2003-07-17 11:41:21 EDT
I think we should only record simple name refs (such as 'AutomaticRouter' 
and 'HashKey') in the index, not refs to A$B names.

Then the BinaryIndexer would breakup the type signature names into their simple 
parts to match. Verifying a match against a .class should be much faster than 
having to parse a source file.
Comment 5 Jerome Lanneluc CLA 2003-07-17 11:51:27 EDT
So how would we find references to A$B where A$B is a top-level type?
Comment 6 Kent Johnson CLA 2003-07-17 12:09:34 EDT
A$B as a top-level typename is strongly discouraged... so I don't 'care' if we 
support it or not. Maybe we should but not at the expense of member type 
references from .class files.

I think the 'bug' is in the BinaryIndexer since it doesn't convert p1/A$B into 
p1.A.B.
Comment 7 Jerome Lanneluc CLA 2003-07-18 10:46:17 EDT
Overrode addTypeReference(...) in BinaryIndexer to replace '$' with '.'.
Comment 8 David Audel CLA 2003-08-28 04:46:06 EDT
Verified.