Bug 170213 - Launch Configuration Name should not allow '#'
Summary: Launch Configuration Name should not allow '#'
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.4 M1   Edit
Assignee: bartosz michalik CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
: 241162 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-11 08:59 EST by C. Lamont Gilbert CLA
Modified: 2008-11-28 13:35 EST (History)
6 users (show)

See Also:


Attachments
first proposal (1.18 KB, text/plain)
2007-07-27 18:07 EDT, bartosz michalik CLA
no flags Details
changes limited to pde.iu (3.09 KB, patch)
2007-07-31 08:35 EDT, bartosz michalik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description C. Lamont Gilbert CLA 2007-01-11 08:59:08 EST
When creating an 'Eclipse Application' launch configuration, if you name it "Configuration #2", it will create a configuration area like so

${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Configuration #2

This fails I assume because of the space preceeding #2.  I am not certain if that is the case, but in any event, if this fails, it should be disallowed by the UI.

This is possibly related to bug #162075
Comment 1 Brian Bauman CLA 2007-01-11 13:23:56 EST
The exception is coming from Update code.  Update needs a URL to save the platform.xml for the launch configuration.  We create a new URL with this path calculated from the launch config name.  When the name has a ' ' with a #, it drops everything past the #, yielding the wrong locations.  To try to create a URL that contains the #, I tried encoding the value before passing it into the URL constructor.  The only problem is that Update does not decode the file path, it just uses it as is.  

Two possible solutions:
1) Get Update to decode the URL before using the path
2) When we calculate the name, make sure there isn't a " #" in the path.  If there is, change it to something else
Comment 2 Wassim Melhem CLA 2007-01-11 13:37:27 EST
let's go with #2
Comment 3 bartosz michalik CLA 2007-07-26 03:55:44 EDT
I'd like to contribute to this bug as Bug Day activity ;)
Comment 4 Wassim Melhem CLA 2007-07-26 08:47:00 EDT
You got it :)

Feel free to ask for help, should you need it.
Comment 5 bartosz michalik CLA 2007-07-27 18:07:43 EDT
Created attachment 74844 [details]
first proposal
Comment 6 Wassim Melhem CLA 2007-07-30 13:46:58 EDT
Bartek,

for this bug, we should not touch Update.  We should modify the PDE code that creates the platform config location that PDE auto-generates to create a good name that does not contain #

Check for references to IPDELauncherConstants.CONFIG_LOCATION in the org.eclipse.pde.ui plug-in.
Comment 7 bartosz michalik CLA 2007-07-31 08:35:35 EDT
Created attachment 75027 [details]
changes limited to pde.iu

this simply approach replaces '#' with 'h' when building configuration location.
any comments are welcome
Comment 8 Wassim Melhem CLA 2007-08-01 00:49:01 EDT
Patch released.  Thanks Bartek.
Comment 9 Chris Aniszczyk CLA 2008-11-28 09:58:31 EST
*** Bug 241162 has been marked as a duplicate of this bug. ***