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

ASCII SUB character is rejected in multi-line comments

XMLWordPrintable

    • hopper
    • sparc
    • solaris_7
    • Verified



      Name: poR10007 Date: 04/14/2000



      Javac incorrectly rejects ASCII SUB character in traditional
      or documentation comments and admits it in single-line
      comments. By the way, SUB character is usual and it is legal
      for this character to appear within comments or a string
      literal, for example.
      Javac (JDK1.3.0A - JDK1.3.0Z) fails to compile the following
      test while oldjavac successfully does:

      -lex00804.java-------------------------------------------

      public class lex00804 {
          public static void main(String args[]) {
      return;
          }
      }
      /* \u001A */

      -Compilation log-----------------------------------------

      $ java -version
      java version "1.3.0rc3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc3-Z)
      Java HotSpot(TM) Client VM (build 1.3.0rc3-Z, interpreted mode)
      $ javac -d . lex00804.java
      lex00804.java:6: unclosed comment
      /* \u001A */
      ^
      lex00804.java:6: illegal character: \26
      /* \u001A */
              ^
      lex00804.java:6: 'class' or 'interface' expected
      /* \u001A */
                  ^
      3 errors
      $ oldjavac -d . lex00804.java; echo $?
      0
      $
      ---------------------------------------------------------

      ======================================================================

            gafter Neal Gafter (Inactive)
            passunw Pas Pas (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: