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

-version:<id> argument affects application arguments containing spaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 5.0
    • tools
    • b39
    • x86
    • windows_xp
    • Verified

        FULL PRODUCT VERSION :
        java version "1.5.0"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
        Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows XP [Version 5.1.2600]

        A DESCRIPTION OF THE PROBLEM :
        Using the -version:<id> option when running a Java application will split arguments containing spaces.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run the simple class added as a test case:

        java -version:1.4+ ShowArgs 1 "2 3" 4


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Should produce:

        1
        2 3
        4
        ACTUAL -
        But produces:

        1
        2
        3
        4

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        public class ShowArgs {
        public static void main(String[] args) {
        for (int i = 0; i < args.length; i++)
        System.out.println(args[i]);
        }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Do not use the -version: option.
        ###@###.### 2005-1-06 22:45:41 GMT

              jkowalsksunw Joseph Kowalski (Inactive)
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: