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

Error compiling valid line terminator.

XMLWordPrintable

    • x86, sparc
    • solaris_2.5.1, windows_nt

      JDK-1.2beta3-F compiler fails to pass JCK test lang/LEX/lex005/lex00504/lex00504.html.
      According to JLS3.4 (p. 14), the ASCII CR character followed by the ASCII LF characted is a valid line terminator and should be processed by the compiler ok.

      However, compiler reports the following error compiling example a.java (see source code below):

      > java -fullversion
      java full version "JDK-1.2beta3-F"
      > javac a.java
      a.java:3: Identifier expected.
              \u000D\u000A
                         ^
      1 error
      >

      // a.java -------------------------
      class a {
      \u000D\u000A
      }
      // end a.java ---------------------


      Name: skT88420 Date: 10/29/99


      java version "1.2.2"
      HotSpot VM (1.0fcs, mixed mode, build E)
      javac generates following error message:

      [10] ep400x004::/quinn/Crap=- javac Crap.java
      Crap.java:3: Invalid character constant.
              char c = '\u000d';
                       ^
      1 error

      when compiling the following example:

      public class Crap {
      public static void main ( String [] args ) {
           char c = '\u000d';
           System.err.println ( "Done!" );
          }
      }
      >> End of example

      javac from JDK 1.1.8 compiles this code without problems.
      (Review ID: 97196)
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            oulyankisunw Oleg Ulyankin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: