Bug 14962 - JDT Search returning improper type
Summary: JDT Search returning improper type
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-30 16:47 EDT by Stef van Dijk CLA
Modified: 2002-05-02 11:05 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 Stef van Dijk CLA 2002-04-30 16:47:44 EDT
This one's going to be tough to provide a case for since it's a programmatic 
search in the context of our plugin rather than one using the Java Search page, 
so I'm hoping if I just describe it maybe it will provide enough of a clue.

I'm using the SearchEngine and doing what seems to be a relatively 
straightforward search. I'm using the method: search(IWorkspace workspace, 
String patternString, int searchFor, int limitTo, IJavaSearchScope scope, 
IJavaSearchResultCollector resultCollector) where the key values are:
patternString= "*"
searchFor= IJavaSearchConstants.TYPE
limitTo=IJavaSearchConstants.DECLARATIONS

The problem is that the result contains 3 instances of SourceType and 1 
SourceMethod. How can I be getting a SourceMethod when searching for type 
declarations? I took a look at the SourceMethod being returned, and it has an 
inner class declared within it which is not included as one of the SourceTypes 
that was returned. Could that be the problem?

I have run our code against several builds (M5, 4/25 Integration Build and the 
4/30 Nightly Build) all with the same result.
Comment 1 Stef van Dijk CLA 2002-04-30 16:56:22 EDT
Ok. I commented out the inner class and the SourceMethod is no longer returned 
by the search engine.
Comment 2 Philipe Mulet CLA 2002-05-01 05:38:50 EDT
There is no Java elements for local members, therefore we answer the enclosing 
toplevel method for these.

We did something similar in VAJ.

Comment 3 Stef van Dijk CLA 2002-05-01 09:19:16 EDT
Ok, I understand now why searching for types could return a method and why it 
would need to do this. Sorry for my confusion. You may shut down this bug 
report.
Comment 4 Philipe Mulet CLA 2002-05-02 11:05:33 EDT
No problem, closing.