You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Stefan Behrensen (Jira)" <ji...@apache.org> on 2020/06/19 09:43:00 UTC

[jira] [Created] (NETBEANS-4470) There is no way do pass an apostrohpe as part of a start argument

Stefan Behrensen created NETBEANS-4470:
------------------------------------------

             Summary: There is no way do pass an apostrohpe as part of a start argument
                 Key: NETBEANS-4470
                 URL: https://issues.apache.org/jira/browse/NETBEANS-4470
             Project: NetBeans
          Issue Type: Bug
    Affects Versions: 11.3
            Reporter: Stefan Behrensen


I tried to pass an apostrophe character as part of an execution argument to my program. The apostrophe (and maybe other characters like quotes) simply get removed from the arguments. Every try to escape the characters in order to prevent a removal failed.

Steps to reproduce:

Create a simple Maven project with a main method like following:
{code:java}
public static void main(String... args) {
  System.out.println(args[0]);
}

{code}
Add a String containing an apostrpohe character in the execution arguments.

Check the nbactions.xml to see if the arguments are present. There should be a run action containing exec.args like 
{code:java}
<exec.args>-classpath %classpath ${packageClassName} a'b'c</exec.args>{code}
Run your project.

Expected result:

The program should print the output a'b'c

Actual result:

The program prints the output abc

No matter how you try to chage the exec.args in order to get to correct characters to be used in the program it does not work.

Ways I have tried:
||argument||result||
|a"'"b"'"c|abc|
|a'''b'''c|abc|
|a\'b\'c|a\\b\\c|
|a&apos;b&apos;c|abc|
|a&#39;b&#39;c|abc|

 

Why is this problematic? I have a program that expects the pattern for a SimpleDateFormat as an argument. Currently I see no way to pass a pattern like {{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"}} to my program when running from netbeans. This works without ptoblem from Eclipse IDE as well as when I run the program from any shell (with respect to the required character escaping).

In the best case there is just a well hidden documentation about how to escape characters in the exec.args that I could not find. In the worst case this is a bug that makes using the netbeans run action impossible to use in certain scenarios.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists