Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350419 - QueuedBuildData cannot handle projects names with spaces
Summary: QueuedBuildData cannot handle projects names with spaces
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 353425 (view as bug list)
Depends on:
Blocks: 344373 349887
  Show dependency tree
 
Reported: 2011-06-27 06:05 EDT by Mark Christiaens CLA
Modified: 2017-09-19 17:03 EDT (History)
3 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
proposed patch (2.15 KB, patch)
2011-06-28 01:38 EDT, Knut Wannheden CLA
sven.efftinge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Christiaens CLA 2011-06-27 06:05:55 EDT
Build Identifier: 20110301-1815

In org.eclipse.xtext.builder.impl.QueuedBuildData.queueURI(URI) the projectName is extracted from an URI with this code: 

String projectName = uri.segment(1);

If the project's name contains a space then you end up with "%20" in your projectName.  The project names used by eclipse are not escaped.  

Reproducible: Always
Comment 1 Mark Christiaens CLA 2011-06-27 06:06:39 EDT
Doing this as a patch:

...
	public void queueURI(URI uri) {
		if (uri.isPlatformResource()) {
			String projectName = URI.decode (uri.segment(1));
			...
Comment 2 Mark Christiaens CLA 2011-06-27 06:09:18 EDT
BTW,

In order to patch this, I had to pretty much copy the entire QueuedBuildData class because its fields are private.  Maybe make those protected?

BTW (2),

This bug also manifests itself as follows: If you create a new project with a space in its name and the project creation also immediately opens a file in that project, then that file doesn't get build properly.  So, it's probably useful to triage the existing bug reports to see if they could be caused by this flaw.
Comment 3 Knut Wannheden CLA 2011-06-28 01:38:12 EDT
Created attachment 198703 [details]
proposed patch

I believe the IStorage2UriMapper should be used here.
Comment 4 Sebastian Zarnekow CLA 2011-07-12 17:09:44 EDT
Mark, thanks for the ticket and the detailed description on how to reproduce the issue.

Thanks for patch and the pointer to the IStorage2URIMapper, Knut. 

Pushed a slightly modified solution to master. Please verify.
Comment 5 Michael Clay CLA 2011-08-03 15:19:07 EDT
*** Bug 353425 has been marked as a duplicate of this bug. ***
Comment 6 Karsten Thoms CLA 2017-09-19 16:52:00 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 7 Karsten Thoms CLA 2017-09-19 17:03:18 EDT
Closing all bugs that were set to RESOLVED before Neon.0