Bug 57036 New Search shows annotations in internal jar (for matches in class file)
3.0 M8 - import org.junit as binary plug-in project - search for references to type "TestListener" - select the library junit.jar - from context menu, choose Open With > Text Editor -> invalid "matches" are shown in the editor Problem is probably in JavaSearchResult#getFile(Object), which should not getUnderlyingResource() for JavaElements not in a ICompilationUnit.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResult.java
public ImageDescriptor getImageDescriptor() {
		return fQuery.getImageDescriptor();
	}
	/* (non-Javadoc)
	 * @see org.eclipse.search.ui.ISearchCategory#getText(org.eclipse.search.core.basic.ITextSearchResult)
	 */
	public String getLabel() {
		int matchCount= getMatchCount();
		String format= null;
		if (matchCount == 1)
			return fQuery.getSingularLabel();
		else 
			format= fQuery.getPluralLabelPattern();
		return MessageFormat.format(format, new Object[] { new Integer(matchCount) });
	}
	public String getTooltip() {
		return getLabel();
	}
	public Match[] computeContainedMatches(AbstractTextSearchResult result, IEditorPart editor) {
		IEditorInput editorInput= editor.getEditorInput();
		if (editorInput instanceof IFileEditorInput)  {
			IFileEditorInput fileEditorInput= (IFileEditorInput) editorInput;
			return computeContainedMatches(result, fileEditorInput.getFile());
		} else if (editorInput instanceof IClassFileEditorInput) {
			IClassFileEditorInput classFileEditorInput= (IClassFileEditorInput) editorInput;
			Set matches= new HashSet();
			collectMatches(matches, classFileEditorInput.getClassFile());
			return (Match[]) matches.toArray(new Match[matches.size()]);
		}
		return null;