Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 162075 - Product configuration launcher arguments section does not support space
Summary: Product configuration launcher arguments section does not support space
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-24 09:21 EDT by Eddie Galvez CLA
Modified: 2008-11-28 12:54 EST (History)
2 users (show)

See Also:


Attachments
proposed patch (2.01 KB, patch)
2007-02-23 10:31 EST, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eddie Galvez CLA 2006-10-24 09:21:33 EDT
I was originally to file this under PDE/UI, but in fact, the underlying processing of the launcher arguments still doesn't allow anybody to use arguments in launcher configurations that have spaces. See the ticket where I originally entered a discussion on, ticket #88766:

-

Alex, the eclipse.ini file cannot possibly come out ok if your usage is the
following:
"My product is called 'My Application' and I want to use the -name feature of
the eclipse launcher to set that"

In the product editor, since no documentation says otherwise, naively you would
enter in the launcher argument multi-line text:

-name My Application

This however causes the ini to have three lines.
Next step, you think "I guess I should have quoted the app name so they dont
cut it up":

-name "My Application"

which, since the quotes aren't processed, just gets you:

-name
"My
Application"

in the ini file (which then gives a command line of  "-name" ""My"
"Application"")

Finally, if you try Alex's last example, say:

>   <launcherArgs>
>      <programArgs>-name
>hello there world</programArgs>
>   </launcherArgs>
>
>where "-name" and "hello there world" were put on 2 separate lines in the
>product editor. 

 As alex points out, that still doesn't work:

>However, when exporting, the eclipse.ini looks like:
>-name
>hello
>there
>world

instead of
-name
hello there world

At least, that's my understanding of Eddie's situation.


In Summary:

The *BUG* is very simple: there is NO WAY to use a space in ANY ARGUMENT in ANY
LAUNCHER built via PDE.



I see the culprit: the use of StringTokenizer to process the launcher arguments, without offering any space-escape syntax.
Comment 1 Pascal Rapicault CLA 2006-10-25 14:24:33 EDT
A part of the problem is in PDE Build but another part may be in PDE UI, cc'ing Wassim to get his opinion.
Comment 2 Wassim Melhem CLA 2006-10-25 14:57:06 EDT
I am not sure how the *.ini file gets processed, but we were giving the instructions to put each word on a separate line.

Perhaps there was ambiguity in the request, and the intent was to put each argument on a separate line.

If that is the case, we should stop using StringTokenizer and use ExecutionArguments from Debug to do the parsing of tokens.
Comment 3 Eddie Galvez CLA 2006-10-25 15:26:54 EDT
(In reply to comment #2)
> I am not sure how the *.ini file gets processed, but we were giving the
> instructions to put each word on a separate line.
> 
> Perhaps there was ambiguity in the request, and the intent was to put each
> argument on a separate line.

 I'm quite sure...

 
> If that is the case, we should stop using StringTokenizer and use
> ExecutionArguments from Debug to do the parsing of tokens.

I can't see that class at this moment, but if that supports some space-syntax escaping or otherwise allows spaces in quoted strings to remain untouched, that's the fix we need! Thank you!

  

Comment 4 Pascal Rapicault CLA 2006-12-15 13:25:12 EST
Marking this bug to be fixed in 3.3. I have opened bug #168247.
Comment 5 Andrew Niefer CLA 2007-02-23 10:31:06 EST
Created attachment 59662 [details]
proposed patch

Proposed patch uses StreamTokenizer with quoting based on " and ', characters 0-32 are whitespace, everything else is part of a word.
Comment 6 Andrew Niefer CLA 2007-02-26 15:26:14 EST
patch released to head