Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329301 - malformed source URLs throw NPE
Summary: malformed source URLs throw NPE
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Michael Rennie CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-02 16:54 EDT by Michael Rennie CLA
Modified: 2010-11-02 16:57 EDT (History)
1 user (show)

See Also:


Attachments
fix (950 bytes, patch)
2010-11-02 16:54 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2010-11-02 16:54:06 EDT
Created attachment 182256 [details]
fix

code from HEAD

if we get a URL like about:blank, or about:home, we fail miserably to lookup the remote source (throw an NPE)

Steps:

1. connect the crossfire client to Firebug
2. open the Ubuntu home page for Firefox (about:home) OR open a new tab and do not navigate to a page (about:blank)
3. select the script in the debug view of the Eclipse client
4. invoke the Open Source... command on it

Happens:

the following NPE

java.lang.NullPointerException
	at org.eclipse.wst.jsdt.debug.internal.core.launching.SourceLookup.getExternalSource(SourceLookup.java:96)
	at org.eclipse.wst.jsdt.debug.internal.core.launching.JavaScriptSourceLookupParticipant.showExternalSource(JavaScriptSourceLookupParticipant.java:93)
	at org.eclipse.wst.jsdt.debug.internal.core.launching.JavaScriptSourceLookupParticipant.findSourceElements(JavaScriptSourceLookupParticipant.java:78)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:141)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doSourceLookup(AbstractSourceLookupDirector.java:490)
	at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.getSourceElement(AbstractSourceLookupDirector.java:758)
	at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.lookup(SourceLookupFacility.java:148)
	at org.eclipse.debug.ui.DebugUITools.lookupSource(DebugUITools.java:777)
	at org.eclipse.wst.jsdt.debug.internal.ui.actions.OpenSourceAction$1.run(OpenSourceAction.java:57)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.wst.jsdt.debug.internal.ui.actions.OpenSourceAction.run(OpenSourceAction.java:54)
	at org.eclipse.wst.jsdt.debug.internal.ui.actions.OpenSourceAction.runWithEvent(OpenSourceAction.java:103)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3557)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3178)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1385)

Expected, the source does not open - without an NPE
Comment 1 Michael Rennie CLA 2010-11-02 16:57:00 EDT
applied patch to HEAD