Project: JDT
Bug 154609 [type hierarchy] NPE in quick outline
Reported: 2006-08-21 16:35:59 | Status: resolved fixed

Using Eclipse 3.2 release version. Not sure what caused it, but quick outline failed in a couple of my editors (several others were open and quick outline was working fine in there) due to a NPE. Things were fine when I closed and reopened those two editors. Hopefully, the stack trace will give you an idea of what went wrong. java.lang.NullPointerException at org.eclipse.jdt.internal.corext.util.MethodOverrideTester.findOverriddenMethod(MethodOverrideTester.java:122) at org.eclipse.jdt.internal.corext.util.MethodOverrideTester.findDeclaringMethod(MethodOverrideTester.java:101) at org.eclipse.jdt.internal.ui.typehierarchy.AbstractHierarchyViewerSorter.getDefiningType(AbstractHierarchyViewerSorter.java:136) at org.eclipse.jdt.internal.ui.typehierarchy.AbstractHierarchyViewerSorter.compare(AbstractHierarchyViewerSorter.java:96) at org.eclipse.jface.viewers.ViewerComparator$1.compare(ViewerComparator.java:184) at java.util.Arrays.mergeSort(Arrays.java:1284) at java.util.Arrays.mergeSort(Arrays.java:1295) at java.util.Arrays.mergeSort(Arrays.java:1295) at java.util.Arrays.sort(Arrays.java:1223) at org.eclipse.jface.viewers.ViewerComparator.sort(ViewerComparator.java:182) at org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildren(AbstractTreeViewer.java:556) at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:719) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:696) at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:892) at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1486) at org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControl$OutlineTreeViewer.internalExpandToLevel(JavaOutlineInformationControl.java:226) at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1496) at org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControl$OutlineTreeViewer.internalExpandToLevel(JavaOutlineInformationControl.java:226) at org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractTreeViewer.java:1278) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1323) at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1266) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:250) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1542) at org.eclipse.jdt.internal.ui.text.AbstractInformationControl.inputChanged(AbstractInformationControl.java:525) at org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControl.setInput(JavaOutlineInformationControl.java:625) at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:858) at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:837) at org.eclipse.jface.text.AbstractInformationControlManager.setInformation(AbstractInformationControlManager.java:308) at org.eclipse.jface.text.information.InformationPresenter.computeInformation(InformationPresenter.java:346) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:821) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:811) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:166) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:201) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:927) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1923) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) 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:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/MethodOverrideTester.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/AbstractHierarchyViewerSorter.java