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

Bug 170213

Summary: Launch Configuration Name should not allow '#'
Product: [Eclipse Project] PDE Reporter: C. Lamont Gilbert <clg-business>
Component: UIAssignee: bartosz michalik <bartosz.michalik>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: bartosz.michalik, baumanbr, caniszczyk, mn, sgandon, wassim.melhem
Version: 3.2.1Keywords: bugday
Target Milestone: 3.4 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
first proposal
none
changes limited to pde.iu none

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. ***