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

\u001a in String Literal

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: