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

Bug 318204

Summary: No white space allowed in paths of debugged scripts
Product: [WebTools] JSDT Reporter: Lehni <lists>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact: Simon Kaegi <simon_kaegi>
Severity: normal    
Priority: P3 CC: Michael_Rennie, thatnitind
Version: 3.2Flags: simon_kaegi: review+
Target Milestone: 3.2.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed fix none

Description Lehni CLA 2010-06-28 12:03:20 EDT
Build Identifier: 20100617-1415

When I try to start the debugger with a breakpoint set in a script that contains a white-space in its path, I get the following exception:


java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:842)
	at org.eclipse.wst.jsdt.debug.internal.core.breakpoints.JavaScriptBreakpoint.addToTarget(JavaScriptBreakpoint.java:152)
	at org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.breakpointAdded(JavaScriptDebugTarget.java:811)
	at org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.initializeBreakpoints(JavaScriptDebugTarget.java:405)
	at org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.initialize(JavaScriptDebugTarget.java:149)
	at org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.<init>(JavaScriptDebugTarget.java:139)
	at org.eclipse.wst.jsdt.debug.internal.core.launching.RemoteJavaScriptLaunchDelegate.launch(RemoteJavaScriptLaunchDelegate.java:76)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.net.URISyntaxException: Illegal character in path at index 10: scripts/My Scripts/Tool.js
	at java.net.URI$Parser.fail(URI.java:2809)
	at java.net.URI$Parser.checkChars(URI.java:2982)
	at java.net.URI$Parser.parseHierarchical(URI.java:3066)
	at java.net.URI$Parser.parse(URI.java:3024)
	at java.net.URI.<init>(URI.java:578)
	at java.net.URI.create(URI.java:840)
	... 11 more


Reproducible: Always
Comment 1 Michael Rennie CLA 2010-06-28 17:02:23 EDT
There are quite a few places where we are using URI.create(string) to create new URIs. This method does not encode special chars, we should be using URIUtil.fromString (or the like) to create our URIs.
Comment 2 Michael Rennie CLA 2010-06-30 11:22:12 EDT
Created attachment 173109 [details]
proposed fix

The patch removes the use of URI.create(..) in favour of URIUtil.fromString(..) which will encode spaces, etc.

The bulk of the fix for this bug was committed with the fix for 318251 due to changes on the same LOC.
Comment 3 Simon Kaegi CLA 2010-06-30 11:43:14 EDT
Looks good.
Comment 4 Michael Rennie CLA 2010-06-30 11:51:34 EDT
applied to HEAD and 3.2.1