Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318204 - No white space allowed in paths of debugged scripts
Summary: No white space allowed in paths of debugged scripts
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Michael Rennie CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 12:03 EDT by Lehni CLA
Modified: 2010-06-30 11:51 EDT (History)
2 users (show)

See Also:
simon_kaegi: review+


Attachments
proposed fix (1.59 KB, patch)
2010-06-30 11:22 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 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