Bug 7156 Search using previous search from Java Search page's list gives wrong results
1. Search via Java Search page (search dialog) 2. Search for something else 3. Select the first Search from the drop down 4. Search ==> searched for wrong java element
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
if (input instanceof IClassFileEditorInput)
			return ((IClassFileEditorInput)input).getClassFile();
		IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();				
		return manager.getWorkingCopy(input);
	}
	private SearchPatternData trySelection(ISelection selection) {
		SearchPatternData result= null;
		if (selection == null)
			return result;
		Object o= null;
		if (selection instanceof IStructuredSelection)
			o= ((IStructuredSelection)selection).getFirstElement();
		if (o instanceof IJavaElement) {
			result= determineInitValuesFrom((IJavaElement)o);
		} else if (o instanceof ISearchResultViewEntry) {
			IJavaElement element= getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker());
			result= determineInitValuesFrom(element);
		} else if (o instanceof IAdaptable) {
			IJavaElement element= (IJavaElement)((IAdaptable)o).getAdapter(IJavaElement.class);
			if (element != null) {
				result= determineInitValuesFrom(element);
			} else {
				IWorkbenchAdapter adapter= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class);
				result= new SearchPatternData(TYPE, REFERENCES, adapter.getLabel(o), null);
			}
		}
		return result;
	}
	private IJavaElement getJavaElement(IMarker marker) {
		try {