Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6518827

(process) zero length Process arguments ignored on win32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 2.0, 6, 6u24
    • core-libs
    • generic, x86, sparc
    • generic, solaris_1, windows_7

      For win32, it appears that java.lang.ProcessImpl is not performing quotation correctly for an argument of length zero. This affects the <java> target in ant when empty command line arguments are passed in. I have attached a short sample test that is runnable from ant. It calls a simple Java class and passes in some arguments. On unix, both tests pass, but on windows, it fails:

      ** fork=false **
      Pass:
      argument 0: "argument0"
      argument 1: ""
      argument 2: "argument2"

      ** fork=true **
      Fail. Only received 2 args:
      argument 0: "argument0"
      argument 1: "argument2"

      I don't think this is an ant issue, as it does not appear that ant converts all the arguments into a single string (as it would be on a command line).
      Adding Kohsuke to the interest list since he did the detective work to narrow down the issue.

            rriggs Roger Riggs
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: