Bug 148949 - JarEntryFile now returning 'null'
Summary: JarEntryFile now returning 'null'
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-28 04:35 EDT by Dani Megert CLA
Modified: 2006-08-07 09:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2006-06-28 04:35:54 EDT
HEAD of JDT Core as of now

The hacky fix for bug 142530 results in JarEntryFile now returning 'null' for the name.

NOTE: as of now the JDT UI code is protected against this but it means we can no longer open these items.

Test Case:
1. create Java project
2. add JUnit 3.8.1 zip to the project and add it to the build path
3. expand junit.swingui.icons
   ==> no label (that is another issue caused by the swirl of the bug fix,
       see bug 148943)
4. try to open one of the icons

==>
!ENTRY org.eclipse.jface 4 2 2006-06-28 10:20:32.743
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.IllegalArgumentException
	at org.eclipse.ui.ide.IDE.getEditorDescriptor(IDE.java:797)
	at org.eclipse.ui.ide.IDE.getEditorDescriptor(IDE.java:757)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.getEditorID(EditorUtility.java:328)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
	at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:190)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:174)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:310)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:659)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:817)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:843)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:815)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1069)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1168)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:249)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:243)
	at org.eclipse.jface.util.OpenStrategy$1.mouseSelectItem(OpenStrategy.java:414)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:350)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	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)
Comment 1 Jerome Lanneluc CLA 2006-06-28 07:09:53 EDT
Sorry about that.

Changed JarPackageFragmentRoot#initPackageFragToTypes(...) to store the full entry path instead of the simple file name.
Added regression test JavaProjectTests#testPackageFragmentNonJavaResources7().
Released for 3.3 M1 in HEAD.

Note that bug 148943 was also the same problem. The path of a JarFileEntry should never be empty.
Comment 2 Frederic Fusier CLA 2006-08-07 09:11:55 EDT
Verified for 3.3 M1 using build I20060807-0010.