Bug 36683 NullPointerException doing search [search]
While searching from a file in the Java Browsing Perspecive, I got the following: !SESSION Apr 20, 2003 17:55:58.749 --------------------------------------------- java.version=1.4.1_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86 -data /home/dgeg/eclipseWorkspaceBinary -install file:/usr/share/eclipse/ !ENTRY org.eclipse.ui 4 4 Apr 20, 2003 17:55:58.753 !MESSAGE Unhandled exception caught in event loop. !ENTRY org.eclipse.ui 4 0 Apr 20, 2003 17:55:58.763 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.ui.actions.FindAction.getType(FindAction.java:332) at org.eclipse.jdt.ui.actions.FindAction.makeOperation(FindAction.java:312) at org.eclipse.jdt.ui.actions.FindAction.run(FindAction.java:272) at org.eclipse.jdt.ui.actions.FindReferencesAction.run(FindReferencesAction.java:83) at org.eclipse.jdt.ui.actions.FindAction.run(FindAction.java:238) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:193) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:169) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:913) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1637) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1429) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindAction.java
workspaceDesc.setAutoBuilding(true);
				try {
					JavaPlugin.getWorkspace().setDescription(workspaceDesc);
				}
				catch (CoreException ex) {
					ExceptionHandler.handle(ex, shell, SearchMessages.getString("Search.Error.setDescription.title"), SearchMessages.getString("Search.Error.setDescription.message")); 
				}
			}				
		}
	}
	JavaSearchOperation makeOperation(IJavaElement element) throws JavaModelException {
		IType type= getType(element);
		return new JavaSearchOperation(JavaPlugin.getWorkspace(), element, getLimitTo(), getScope(type), getScopeDescription(type), getCollector());
	};
	abstract int getLimitTo();
	IJavaSearchScope getScope(IType element) throws JavaModelException {
		return SearchEngine.createWorkspaceScope();
	}
	JavaSearchResultCollector getCollector() {
		return new JavaSearchResultCollector();
	}
	
	String getScopeDescription(IType type) {
		return SearchMessages.getString("WorkspaceScope"); 
	}
	IType getType(IJavaElement element) {
		IType type= null;
		if (element.getElementType() == IJavaElement.TYPE)
			type= (IType)element;
		else if (element instanceof IMember)