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/ui/actions/FindAction.java
type= ((IMember)element).getDeclaringType();
		if (type != null) {
			ICompilationUnit cu= type.getCompilationUnit();
			if (cu == null)
				return type;
				
			IType wcType= (IType)getWorkingCopy(type);
			if (wcType != null)
				return wcType;
			else
				return type;
		}
		return null;
	}
	
	/**
	 * Tries to find the given element in a working copy.
	 */
	private IJavaElement getWorkingCopy(IJavaElement input) {
		try {
			if (input instanceof ICompilationUnit)
				return EditorUtility.getWorkingCopy((ICompilationUnit)input);
			else
				return EditorUtility.getWorkingCopy(input, true);
		} catch (JavaModelException ex) {
		}
		return null;
	}
}