Bug 5328 NPE in Open Super Method action
1) make an empty selection in the text editor outside of a type's range, e.g, in the import 2) execute Show in Packages View ->NPE Notice: I've changed the Show in Packages View action and it might be the culprit. Issue: unclear why this code is executed when running the other action. org.eclipse.jface.util.Assert$AssertionFailedException: null argument; at org.eclipse.jface.util.Assert.isNotNull(Assert.java:133) at org.eclipse.jface.util.Assert.isNotNull(Assert.java(Compiled Code)) at org.eclipse.jface.viewers.StructuredSelection.<init> (StructuredSelection.java:54) at org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider$Adapter.asStruct uredSelection(StructuredSelectionProvider.java:75) at org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider$Adapter.asStruct uredSelection(StructuredSelectionProvider.java:48) at org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider$SelectionService Adapter.getSelection(StructuredSelectionProvider.java:138) at org.eclipse.jdt.internal.ui.actions.OpenSuperImplementationAction.getMethod (OpenSuperImplementationAction.java:69) at org.eclipse.jdt.internal.ui.actions.OpenSuperImplementationAction.canOperateOn (OpenSuperImplementationAction.java:61) at org.eclipse.jdt.internal.ui.actions.OpenSuperImplementationAction.update (OpenSuperImplementationAction.java:57) at org.eclipse.ui.texteditor.AbstractTextEditor.addAction (AbstractTextEditor.java:1693) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.editorContextMenuAboutToShow (JavaEditor.java:138) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.editorContextMenuAb outToShow(CompilationUnitEditor.java:298) at org.eclipse.ui.texteditor.AbstractTextEditor$2.menuAboutToShow (AbstractTextEditor.java:659) at org.eclipse.jface.action.MenuManager.fireAboutToShow (MenuManager.java:220) at org.eclipse.jface.action.MenuManager.handleAboutToShow (MenuManager.java:253) at org.eclipse.jface.action.MenuManager.access$0(MenuManager.java:250) at org.eclipse.jface.action.MenuManager$1.menuShown (MenuManager.java:280) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:112) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:828) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:2787) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:983) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu.setVisible(Menu.java:740) at org.eclipse.swt.widgets.Control.WM_CONTEXTMENU(Control.java:2612) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java (Compiled Code)) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java (Compiled Code)) at org.eclipse.swt.widgets.Control.WM_RBUTTONUP(Control.java:3446) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code)) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1136) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1165) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:675) at org.eclipse.ui.internal.Workbench.run(Workbench.java:658) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:820) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at SlimLauncher.main(SlimLauncher.java:14)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/StructuredSelectionProvider.java
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
package org.eclipse.jdt.internal.ui.actions;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISelectionService;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICodeAssist;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IWorkingCopyManager;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
/**
 */
public abstract class StructuredSelectionProvider {