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

javac does not handle "\u005c" correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: 1.1.3
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: