Community
Participate
Working Groups
I tried to open "package.html" which was in a jar (org.elcipse.core.boot/boot.jar). I got the following: !MESSAGE Unhandled exception caught in event loop. !ENTRY org.eclipse.ui 4 0 May 23, 2002 11:18:46.71 !MESSAGE org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput !STACK 0 java.lang.ClassCastException: org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput at org.eclipse.ui.internal.EditorManager.openEditor (EditorManager.java:383) at org.eclipse.ui.internal.WorkbenchPage.openEditor (WorkbenchPage.java:1701) at org.eclipse.ui.internal.WorkbenchPage.openEditor (WorkbenchPage.java:1669) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor (EditorUtility.java:137) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor (EditorUtility.java:108) at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open (OpenActionUtil.java:52) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:167) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:156) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:178) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:156) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen (PackageExplorerActionGroup.java:321) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$5.open (PackageExplorerPart.java:297) at org.eclipse.jface.viewers.StructuredViewer.fireOpen (StructuredViewer.java:320) at org.eclipse.jface.viewers.StructuredViewer.handleOpen (StructuredViewer.java:494) at org.eclipse.jface.viewers.StructuredViewer$3.handleOpen (StructuredViewer.java:581) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent (OpenStrategy.java:198) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:195) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:222) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:200) at org.eclipse.core.launcher.Main.run(Main.java:643) at org.eclipse.core.launcher.Main.main(Main.java:476)
Opening editors on jar entries (IStorageEditorInputs) works OK when there is a registered editor that can handle IStorageEditor input. It works for .properties files, for example. When There is no registered editor and the system editor is used then the workbench assumes that it is a IFileEditor input since external editors can only be opened on files. This hard cast is questionable. Possible solutions: a) the code should checks wheter the editor is an IFileEditorInput and throws a PartInitException. b) the code is generalized so that it can also handle IStorageInput, i.e., the StorageInput's contents is copied into a tmp file and an editor is opened on the temp file. I suggest that at least a) is done. Moving to Platform UI for comment.
(Although it looks like this stack dump is in JDT, it is not). The openEditor methods should not make assumptions about type of input. Should just throw PartInitException in this case.
Released changes in EditorManager to throw PartInitException. Resolving as LATER, so we can write openEditor in terms of IStorage instead of IFile?
Reopened for investigation
Moving Dougs bugs
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Closing for lack of activity.