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

Showing incorrect result while passing specific argument in the Java launcher tools

XMLWordPrintable

    • b06
    • b126
    • x86_64
    • windows
    • Verified

        FULL PRODUCT VERSION :
        java version "1.8.0_60"
        Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
        Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 10.0.10240]

        A DESCRIPTION OF THE PROBLEM :
        This is an error in the "java" launcher tool -- I couldn't find a category for that.
        Command line arguments, quoted and containing the 2 adjacent characters "\\*", adds extra "\\" characters to the argument. Really odd. Examples:
            Argument Character in arg received by process (raw, no escapes)
            "a\*\b" a\*\\b
            "a\*\*\b" a\*\\*\\\b
            "a\*\*\*\b" a\*\\*\\\*\\\\b
        This has been demonstrated on Windows 10 and Vista, using Java 8-60. I haven't test with older releases. I don't think it's a windows shell problem, as I get expected results using Python, Ruby, Go,
        and a batch script. I suspect the "java" tool is doing something to the args.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run my little included program with arguments from my description.
        E.g.
           java Arg0 "a\*\b"

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        a\*\b"
        ACTUAL -
        a\*\\b

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        Arg0.java

        class Arg0 {
            public static void main(String[] args) {
                System.out.println(args[0]);
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        None yet

              robm Robert Mckenna
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: