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

Bug 332785

Summary: [Crossfire] NPE when getting source from local file system
Product: [WebTools] JSDT Reporter: Grant Gayed <grant_gayed>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact: Michael Rennie <Michael_Rennie>
Severity: normal    
Priority: P3 CC: thatnitind
Version: unspecified   
Target Milestone: 3.3 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch none

Description Grant Gayed CLA 2010-12-16 14:31:05 EST
- make a connection via Crossfire to a running IE or Firefox
- navigate it to a file on the local file system
- in the Debug view show the scripts, the first one will appear as something like "file:c:/.../name.html"
- select this first script, right-click -> Open Source
- the following NPE happens:

java.lang.NullPointerException
    at org.eclipse.core.runtime.Path.<init>(Path.java:153)
    at org.eclipse.wst.jsdt.debug.internal.core.launching.SourceLookup.getExternalSource(SourceLookup.java:100)
    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.runInUIThread(OpenSourceAction.java:63)
    at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
<snip>
Comment 1 Carolyn MacLeod CLA 2011-02-25 12:06:17 EST
Created attachment 189831 [details]
patch

Michael can you review and commit any desired changes?
Comment 2 Grant Gayed CLA 2011-02-25 12:37:19 EST
To clarify, that was me in the last comment.  I was working on a shared machine, and obviously Car was left logged in on its bugzilla from a previous test pass.
Comment 3 Michael Rennie CLA 2011-02-25 15:36:12 EST
(In reply to comment #2)
> To clarify, that was me in the last comment.  I was working on a shared
> machine, and obviously Car was left logged in on its bugzilla from a previous
> test pass.

No worries, I was excited that there might have been another person wanting to help with JSDT :)

I fixed this bug in a different way with the changes to bug 328531 - sorry I did not realize that until I tried to apply your patch. 

For the current changes see SourceLookup#getSourcePath(uri).