Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370509 - New E4 Application wizard does not handle spaces in project name
Summary: New E4 Application wizard does not handle spaces in project name
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-02 18:35 EST by Curtis Windatt CLA
Modified: 2012-02-07 14:08 EST (History)
4 users (show)

See Also:


Attachments
Patch for spaces in product id (1.60 KB, patch)
2012-02-02 18:35 EST, Curtis Windatt CLA
no flags Details | Diff
Better fix (9.98 KB, patch)
2012-02-03 17:34 EST, Curtis Windatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2012-02-02 18:35:16 EST
Created attachment 210481 [details]
Patch for spaces in product id

1) Create a new project > new e4 application project
2) Choose a project name with spaces or another disallowed character
3) Complete the wizard
4) Try running the product
Result:
Application could not start because the product is not found

There are two problems here:
1) The product name should have it's spaces replaced with underscores so the product configuration has the right settings.  I have attached a patch to deal with this.

2) The application model uri set in E4Application.loadApplicationModel() does not handle the spaces correctly leading to an IOException.  I am not sure if this is because of incorrect escaping or the application is looking at the project name instead of the plug-in name.
Comment 1 Curtis Windatt CLA 2012-02-03 17:34:10 EST
Created attachment 210530 [details]
Better fix

This patch provides a better solution for validating the product/plug-in id in the wizard.

One additional restriction I discovered is that the xmi model URI parser doesn't handle plug-in names that contain underscores and numbers well.  It assumes that if an underscore exists in the URI, it must be trying to describe a plug-in version.  I'm not sure who specifies the URI structure.
See: PlatformURLPluginConnection.parse()
Comment 2 Curtis Windatt CLA 2012-02-03 17:35:32 EST
Remy, is this where bugs against org.eclipse.e4.tools should be filed or is platform UI responsible for them as well?
Comment 3 Remy Suen CLA 2012-02-03 18:08:25 EST
(In reply to comment #2)
> Remy, is this where bugs against org.eclipse.e4.tools should be filed or is
> platform UI responsible for them as well?

e4/UI is correct, Curtis.
Comment 4 Eric Moffatt CLA 2012-02-07 14:08:47 EST
Pushed (on Curtis' behalf) in >20120207.

commit c68d805b69bd6c2cc50ce2f3ac75b49c4ac91db7

Curtis, nice fix, thanks...

BTW while I doubt we'll be doing many other fixes here it turns out that there is indeed a GIT repo for this...but the patch applied fine.