Bug 128363 NPE in JavaSearchEditorOpener
Build: I20060216-2000 1. Checked out org.eclipse.pde.ui from head 2. Right-click on the org.eclipse.pde.internal.ui.compare package and seach for references. 3. You will get three hits: one in the manifest.mf and two in the plugin.xml. Double-click on the plugin.xml and you will get this NPE in JavaSearchEditorOpener Something in general seems to have changed in the Java search participant code as I am getting weird results on many fronts. This is one of them. eclipse.buildId=unknown java.version=1.4.2_05 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.sdk.ide -pdelaunch Command-line arguments: -product org.eclipse.sdk.ide -data D:\Eclipse\UpdatedSource\plugins/../runtime-EclipseApplication -dev file:D:/Eclipse/UpdatedSource/plugins/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -pdelaunch -os win32 -ws win32 -arch x86 Error 2006-02-17 03:28:25.371 Problems occurred when invoking code from plug-in: "org.eclipse.search". java.lang.NullPointerException at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.setReusedEditor(JavaSearchEditorOpener.java:220) at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.showInEditor(JavaSearchEditorOpener.java:200) at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.showWithReuse(JavaSearchEditorOpener.java:122) at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.openElement(JavaSearchEditorOpener.java:100) at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.openMatch(JavaSearchEditorOpener.java:107) at org.eclipse.jdt.internal.ui.search.JavaSearchResultPage.showMatch(JavaSearchResultPage.java:205) at org.eclipse.search.ui.text.AbstractTextSearchViewPage$7.run(AbstractTextSearchViewPage.java:767) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.search.ui.text.AbstractTextSearchViewPage.showMatch(AbstractTextSearchViewPage.java:771) at org.eclipse.search.ui.text.AbstractTextSearchViewPage.showCurrentMatch(AbstractTextSearchViewPage.java:836) at org.eclipse.search.ui.text.AbstractTextSearchViewPage.gotoNextMatch(AbstractTextSearchViewPage.java:801) at org.eclipse.search.ui.text.AbstractTextSearchViewPage.handleOpen(AbstractTextSearchViewPage.java:1204) at org.eclipse.jdt.internal.ui.search.JavaSearchResultPage.handleOpen(JavaSearchResultPage.java:789) at org.eclipse.search.ui.text.AbstractTextSearchViewPage$5.open(AbstractTextSearchViewPage.java:647) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:780) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:816) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:778) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1009) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1108) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:244) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:239) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:278) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3287) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2907) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1899) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:417) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:99) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) 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.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchEditorOpener.java
if (editor != null) {
				fPartService= editor.getSite().getWorkbenchWindow().getPartService();
				fPartService.addPartListener(this);
			} else {
				fPartService= null;
			}
		}
		
		public void partOpened(IWorkbenchPart part) {
		}
		public void partDeactivated(IWorkbenchPart part) {
		}
		public void partClosed(IWorkbenchPart part) {
			if (part == fReusedEditor) {
				initialize(null);
			}
		}
		public void partActivated(IWorkbenchPart part) {
		}
		public void partBroughtToTop(IWorkbenchPart part) {
		}
	}
	
	private ReusedEditorWatcher fReusedEditorWatcher;
	public IEditorPart openElement(Object element) throws PartInitException, JavaModelException {
		IWorkbenchPage wbPage= JavaPlugin.getActivePage();
		if (NewSearchUI.reuseEditor())
			return showWithReuse(element, wbPage);
		else
			return showWithoutReuse(element, wbPage);