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

\u001a in String Literal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.2.0
    • tools
    • x86
    • windows_nt



      Name: igT44549 Date: 02/08/99


      JDK1.1.7 javac can compile the following code
      with no error, but I think it is a bug of javac.

      class Test {
          final String = "\u001a";
      }

      The corespoiding Unicode character of the Unicode
      Escape '\u001a' is EOF on MS Windows System.

      The JLS says that the translation of Unicode
      Escapes to the corresponding Unicode character
      is processed before lexical analysis.

      Then, lexical analysis step is applied for
      the stream of the resulting of the translation,
      which is
        class Test { final String = "<EOF>.
      I think the javac should be report an error
      against the stream. However, the current
      implementation of javac does not report any
      error.

      When the "\u000d" is written Instead of '\u001a",
      the javac report an error.
      It is correct behaivor.
      (Review ID: 42921)
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            iris Iris Clark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: