Bug 6967 Exception while right-clicking in text editor
I was editing a java file (happened to be OS.java in SWT win32). I right-clicked in order to pop up the context menu, and I got the attached dialog, with the following walkback in the .log file: Log: Fri Dec 14 16:06:19 EST 2001 4 org.eclipse.jdt.ui 1 Internal Error Java Model Exception: Java Model Status [org.eclipse.swt.internal.win32 does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:448) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:477) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java(Compiled Code)) at org.eclipse.jdt.internal.core.SourceRefElement.getSourceRange (SourceRefElement.java(Compiled Code)) at org.eclipse.jdt.internal.core.JavaElement.getSourceElementAt (JavaElement.java(Compiled Code)) at org.eclipse.jdt.internal.core.CompilationUnit.getElementAt (CompilationUnit.java:285) at org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider$Adapter.asStruct uredSelection(StructuredSelectionProvider.java:74) 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:142) 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:1845) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.editorContextMenuAboutToShow (JavaEditor.java:136) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.editorContextMenuAb outToShow(CompilationUnitEditor.java:526) at org.eclipse.ui.texteditor.AbstractTextEditor$2.menuAboutToShow (AbstractTextEditor.java:710) 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 (Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:2915) at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code)) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java (Compiled Code)) 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:777) at org.eclipse.swt.widgets.Control.WM_CONTEXTMENU(Control.java:2740) 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:3590) 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(Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:758) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:820) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362) 4 org.eclipse.jdt.core 969 org.eclipse.swt.internal.win32 does not exist. Cannot reproduce, even immediately afterward - seems to be a one-time thing.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/StructuredSelectionProvider.java
private ISelectionProvider fProvider; 
		public SelectionProviderAdapter(ISelectionProvider provider) {
			super();
			fProvider= provider;
			Assert.isNotNull(fProvider);
		}
		public IStructuredSelection getSelection(int flags) {
			ISelection result= fProvider.getSelection();
			if (result instanceof IStructuredSelection)
				return (IStructuredSelection)result;
			if (result instanceof ITextSelection && fProvider instanceof IEditorPart)
				return asStructuredSelection((ITextSelection)result, (IEditorPart)fProvider, flags);
			return StructuredSelection.EMPTY;
		}
	}
	
	private static class SelectionServiceAdapter extends Adapter {
		private ISelectionService fService; 
		public SelectionServiceAdapter(ISelectionService service) {
			super();
			fService= service;