javac does not handle "\u005c" correctly

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P2
    • None
    • Affects Version/s: 1.1.3
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: