Bug 45448 Operation unavailable attempting to search a local variable [search]
Build 20031023 Selecting a local variable declaration in a Java editor and attempting to search for references to this local variable brings up a dialog saying the the operation is unavailable for the selected element.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchResultLabelProvider.java
private IJavaElement getJavaElement(IMarker marker, ISearchResultViewEntry entry) {
		if (fLastMarker != marker) {
			boolean canUseGroupByKey= !marker.getAttribute(SearchUI.POTENTIAL_MATCH, false)
								&& !marker.getAttribute(IJavaSearchUIConstants.ATT_IS_WORKING_COPY, false)
								&& !marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID_CHANGED, false);
			if (canUseGroupByKey && entry.getGroupByKey() instanceof IJavaElement)
				fLastJavaElement= (IJavaElement)entry.getGroupByKey();
			else
				fLastJavaElement= SearchUtil.getJavaElement(marker);
			fLastMarker= marker;
		}
		return fLastJavaElement;
	}
	public void addListener(ILabelProviderListener listener) {
		super.addListener(listener);
		fLabelProvider.addListener(listener);
	}
	public void dispose() {
		super.dispose();
		fLabelProvider.dispose();
	}
	public boolean isLabelProperty(Object element, String property) {
		return fLabelProvider.isLabelProperty(element, property);
	}
	public void removeListener(ILabelProviderListener listener) {
		super.removeListener(listener);
		fLabelProvider.removeListener(listener);
	}
}