Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316169 - NPE trying to show source
Summary: NPE trying to show source
Status: CLOSED WORKSFORME
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 12:22 EDT by Michael Rennie CLA
Modified: 2010-06-30 11:45 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 Michael Rennie CLA 2010-06-08 12:22:35 EDT
code from HEAD

working on Crossfire I got the following NPE trying to show source for a generated script:

java.lang.NullPointerException
at java.net.URI$Parser.parse(URI.java:3003)
at java.net.URI.<init>(URI.java:578)
at java.net.URI.create(URI.java:840)
at org.eclipse.wst.jsdt.debug.internal.core.launching.JavaScriptSourceLookupParticipant.getSourceURI(JavaScriptSourceLookupParticipant.java:113)
at org.eclipse.wst.jsdt.debug.internal.core.launching.JavaScriptSourceLookupParticipant.findSourceElements(JavaScriptSourceLookupParticipant.java:63)
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.debug.internal.ui.elements.adapters.StackFrameSourceDisplayAdapter$SourceLookupJob.run(StackFrameSourceDisplayAdapter.java:109)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

The method IJavaScriptStackFrame#sourceURI() is spec'd to return null, we should at least handle it properly.

Steps

1. install the crossfire bundle (or launch your target with the source)
2. run the auto-attach option
3. debug google.ca
4. suspend one of the threads

Happens:
NPE

Expected:
script suspends, stackframe shows up and source is displayed.
Comment 1 Michael Rennie CLA 2010-06-08 12:24:43 EDT
(In reply to comment #0)
> 
> The method IJavaScriptStackFrame#sourceURI() is spec'd to return null, we
> should at least handle it properly.
> 

correction that should be IJavaScriptStackFrame#getSourcePath()
Comment 2 Michael Rennie CLA 2010-06-30 11:45:26 EDT
Closing. This bug was fixed with changes in the Crossfire bundle to properly create URI paths when the reported path was "/"