Project: JDT
Bug 186473 A NullPointerException is thrown when switching between Java editors in the Eclipse workbench
Reported: 2007-05-10 19:45:40 | Status: verified fixed

This happens when either using the mouse or keyboard shortcuts to switch between editors. I am using the HTMLBuddy plugin, and this appears to only happen when I navigate to an XML file. This did not happen with 3.3 M6. Below is from the error log view: eclipse.buildId=I20070503-1400 java.version=1.5.0_11 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -startup C:\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070502.jar Command-line arguments: -os win32 -ws win32 -arch x86 -startup C:\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070502.jar Error Thu May 10 16:34:12 PDT 2007 Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.findJavaAnnotation(JavaSelectAnnotationRulerAction.java:145) at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.update(JavaSelectAnnotationRulerAction.java:104) at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.update(AbstractRulerActionDelegate.java:133) at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.setActiveEditor(AbstractRulerActionDelegate.java:90) at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.updateDelegate(ActionDelegateHandlerProxy.java:292) at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.isEnabled(ActionDelegateHandlerProxy.java:464) at org.eclipse.core.commands.Command.isEnabled(Command.java:831) at org.eclipse.core.commands.Command.setHandler(Command.java:938) at org.eclipse.ui.internal.handlers.HandlerAuthority.updateCommand(HandlerAuthority.java:535) at org.eclipse.ui.internal.handlers.HandlerAuthority.sourceChanged(HandlerAuthority.java:496) at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:305) at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:285) at org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:98) at org.eclipse.ui.internal.services.ActivePartSourceProvider.checkActivePart(ActivePartSourceProvider.java:202) at org.eclipse.ui.internal.services.ActivePartSourceProvider.access$0(ActivePartSourceProvider.java:142) at org.eclipse.ui.internal.services.ActivePartSourceProvider$1.partDeactivated(ActivePartSourceProvider.java:90) at org.eclipse.ui.internal.PartListenerList$4.run(PartListenerList.java:117) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57) at org.eclipse.ui.internal.PartListenerList.firePartDeactivated(PartListenerList.java:115) at org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:113) at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:165) at org.eclipse.ui.internal.WWinPartService.updateActivePart(WWinPartService.java:124) at org.eclipse.ui.internal.WWinPartService.access$0(WWinPartService.java:115) at org.eclipse.ui.internal.WWinPartService$1.partDeactivated(WWinPartService.java:48) at org.eclipse.ui.internal.PartListenerList2$4.run(PartListenerList2.java:113) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(PartListenerList2.java:111) at org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:116) at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:165) at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:56) at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126) at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3288) at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:601) at org.eclipse.ui.internal.CycleBaseHandler.activate(CycleBaseHandler.java:376) at org.eclipse.ui.internal.CycleBaseHandler.execute(CycleBaseHandler.java:108) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:239) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:475) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:426) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:165) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:467) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:791) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:838) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:565) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:507) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:124) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1139) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947) at org.eclipse.swt.widgets.Control.traverse(Control.java:3377) at org.eclipse.swt.widgets.Control.translateTraversal(Control.java:3359) at org.eclipse.swt.widgets.Composite.translateTraversal(Composite.java:973) at org.eclipse.swt.widgets.Display.translateTraversal(Display.java:4195) at org.eclipse.swt.widgets.Display.filterMessage(Display.java:1153) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3280) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaSelectAnnotationRulerAction.java