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

Bug 369203

Summary: NPE in IDEWorkbenchWindowAdvisor.computeTitlePath with jar-URI
Product: [Eclipse Project] Platform Reporter: Peter Zeller <p_zeller>
Component: IDEAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: pwebster, remy.suen, stolz+bugzilla
Version: 4.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Peter Zeller CLA 2012-01-20 06:31:19 EST
Build Identifier: M20110909-1335

When opening a file, which is inside a jar file. A NPE is thrown. The reason is that uri.getPath() is null if the URI is a jar URI like "jar:file:/C:/somepath/test.jar!/test.txt".

The URI is created in a plugin via the URIUtil.toJarURI method.

Stack trace:

java.lang.NullPointerException
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor.computeTitlePath(IDEWorkbenchWindowAdvisor.java:444)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor.setTitlePath(IDEWorkbenchWindowAdvisor.java:437)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor.recomputeTitle(IDEWorkbenchWindowAdvisor.java:426)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor.updateTitle(IDEWorkbenchWindowAdvisor.java:498)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor.access$3(IDEWorkbenchWindowAdvisor.java:461)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor$4.partBroughtToTop(IDEWorkbenchWindowAdvisor.java:310)
	at org.eclipse.ui.internal.PartListenerList2$2.run(PartListenerList2.java:85)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:55)
	at org.eclipse.ui.internal.PartListenerList2.firePartBroughtToTop(PartListenerList2.java:83)
	at org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:212)
	at org.eclipse.ui.internal.WWinPartService$WWinListener.partBroughtToTop(WWinPartService.java:42)
	at org.eclipse.ui.internal.PartListenerList2$2.run(PartListenerList2.java:85)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:55)
	at org.eclipse.ui.internal.PartListenerList2.firePartBroughtToTop(PartListenerList2.java:83)
	at org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:212)
	at org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop(WorkbenchPagePartList.java:76)
	at org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged(WorkbenchPagePartList.java:52)
	at org.eclipse.ui.internal.PartList.setActiveEditor(PartList.java:162)
	at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1355)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3629)
	at org.eclipse.ui.internal.WorkbenchPage.internalActivate(WorkbenchPage.java:691)
	at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:663)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2957)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
	at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:439)
	at eu.hatsproject.absplugin.util.UtilityFunctions.openABSEditorForFile(UtilityFunctions.java:512)
	at eu.hatsproject.absplugin.navigator.NavigatorUtils.openEditor(NavigatorUtils.java:64)
	at eu.hatsproject.absplugin.navigator.actionProvider.DoubleClickAction.run(DoubleClickAction.java:34)
	at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
	at org.eclipse.ui.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:185)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
	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:864)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
	at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
	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:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Reproducible: Always

Steps to Reproduce:
1. Try to open a file with a URI pointing to a file inside a jar

Or:

1. install http://tools.hats-project.eu/eclipseplugin/installation.html
2. create new ABS project
3. put a jar file which contains at least one *.abs file into the project
4. make sure you are in the ABS perspective
5. try to open a file inside the jar
Comment 1 Lars Vogel CLA 2019-11-14 03:51:07 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.