Using the search engine to find references of an annotation type does not produce any findings in the required plug-ins of a plug-in project. Take a look at the following search configuration:
The above configuration does not find the expected matches of myAnnotationName inside the required plug-ins of myJavaProject. The required plug-ins are binary.
The strange thing is that all references are found when extending the scope to the entire workspace searching for type references:
So it seems that broadening the search space leads to more findings, although IMHO all matches should also be found when the search space is restricted to the respective project only.
Using the search engine to find references of an annotation type does not produce any findings in the required plug-ins of a plug-in project. Take a look at the following search configuration:
SearchPattern pattern = SearchPattern.createPattern(myAnnotationName, IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH);
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {myJavaProject}, true);
The above configuration does not find the expected matches of myAnnotationName inside the required plug-ins of myJavaProject. The required plug-ins are binary.
The strange thing is that all references are found when extending the scope to the entire workspace searching for type references:
SearchPattern pattern = SearchPattern.createPattern(myAnnotationName, IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, SearchPattern.R_EXACT_MATCH);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
So it seems that broadening the search space leads to more findings, although IMHO all matches should also be found when the search space is restricted to the respective project only.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=578102