Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317066

Summary: [breadcrumb] Exception on clicking folders contained in jars
Product: [Eclipse Project] JDT Reporter: Deepak Azad <deepakazad>
Component: TextAssignee: Deepak Azad <deepakazad>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix none

Description Deepak Azad CLA 2010-06-16 12:15:30 EDT
Breadcrumb pop-up throws the following exception when clicking on folders contained in jars, e.g the META-INF folder contained in rt.jar

org.eclipse.ui.PartInitException: Could not get an editor input for the given element
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.throwPartInitException(EditorUtility.java:385)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:176)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:152)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditorBreadcrumb.openInNewEditor(JavaEditorBreadcrumb.java:889)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditorBreadcrumb.open(JavaEditorBreadcrumb.java:846)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.EditorBreadcrumb.doOpen(EditorBreadcrumb.java:350)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.EditorBreadcrumb.doRevealOrOpen(EditorBreadcrumb.java:335)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.EditorBreadcrumb.access$8(EditorBreadcrumb.java:332)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.EditorBreadcrumb$3.open(EditorBreadcrumb.java:254)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbViewer.fireMenuSelection(BreadcrumbViewer.java:541)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbItemDropDown.openElement(BreadcrumbItemDropDown.java:502)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbItemDropDown.access$4(BreadcrumbItemDropDown.java:497)
	at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbItemDropDown$4.mouseUp(BreadcrumbItemDropDown.java:359)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:213)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:600)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Deepak Azad CLA 2010-06-16 13:45:42 EDT
Created attachment 172063 [details]
fix

Added a check to see if the IJarEntryResource is a file or not before trying to open it in an editor.

Fixed in HEAD.
Comment 2 Deepak Azad CLA 2010-06-16 13:47:27 EDT
.