Search for constructor invocations with parameters [message #757707] |
Mon, 21 November 2011 05:08  |
Eclipse User |
|
|
|
Hello,
I've got the following problem:
I'm trying to search for constructor invocations for constructors with parameters. I have tried searching for constructors without parameters and it worked fine. However searching for constructor invocations, when constructors have parameters doesn't find any searchMatches.
I tried the following code with variations:
public final static int GENERICS_AGNOSTIC_MATCH_RULE = SearchPattern.R_EXACT_MATCH
| SearchPattern.R_CASE_SENSITIVE
| SearchPattern.R_EQUIVALENT_MATCH;
SearchPattern pattern = SearchPattern.createPattern(element,
IJavaSearchConstants.REFERENCES, /* I also tried CLASS_INSTANCE_CREATION_TYPE_REFERENCE and even ALL_OCCURRENCES */
GENERICS_AGNOSTIC_MATCH_RULE);
// the scope is a PackageFragmentRoot for src folder -
// obtained with ... getPackageFragmentRoot(sourceFolder);
IJavaSearchScope searchScope = SearchEngine.createJavaSearchScope(scope);
SearchEngine searchEngine = new SearchEngine();
searchEngine.search(pattern, new SearchParticipant[] { SearchEngine
.getDefaultSearchParticipant() }, searchScope, requestor,
null /* progress monitor */);
This code works fine for searching method invocations and constructor invocations without parameters.
Please help.
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07660 seconds