Community
Participate
Working Groups
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.
Ok. I commented out the inner class and the SourceMethod is no longer returned by the search engine.
There is no Java elements for local members, therefore we answer the enclosing toplevel method for these. We did something similar in VAJ.
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.
No problem, closing.