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

Problem reading a program argument containing \\\ and """

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 8
    • tools
    • None
    • other
    • windows_7

      The following program gives different results when run on Java 6 as compared to Java 8. See comments
      in the program for details.


      public class replTest
      {
        // When run on Windows 7, this program prints different results depending on which
        // version of Java is run. When run with build 1.6.0-b105 (hotspot server) the command
        //
        // java replTest \\\""1.8.0"\\\"
        //
        // prints the following: Input: \"1.8.0\"
        //
        // When run with build 1.8.0-ea-b57 (hotspot server) the same command gives a different result:
        //
        // Input: \""1.8.0\"
        //
        public static void main(String args[])
        {
            System.out.println("Input: " + args[0]);
        }
      }

            ksrini Kumar Srinivasan
            hseigel Harold Seigel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: