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

javac does not handle "\u005c" correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 1.1.3
    • tools
    • generic
    • generic

      The following code doesn't get compiled.

      class backslash
      {
              public static void main(String args[]){
                              System.out.println("\u005c");
              }
      }

      backslash.java:4: String not terminated at end of line.
                              System.out.println("\u005c");
                                                 ^
      backslash.java:5: ')' expected.
              }
      ^
      2 errors

      When "\u005c" is parsed by the compiler, it assumes that "\" translated from
      \u005c is escape backslash and treat the following " as just single character rather than string termination sign.

            dstoutamsunw David Stoutamire (Inactive)
            sishidasunw Shoji Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: