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

j2sdk1.4.1 doesn't support comments after the last bracket

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.1
    • tools
    • x86
    • windows_2000

      I used javac of j2sdk1.4.1 to compile the following codes:
      public class comment {
        public static void main(String argv[]) {
          System.out.println("comment");
        }
      } //end comment

      But the compiler complaint:
      comment.java:5: unclosed comment
      } //end comment
      1 error

      The more intesting thing is when I add a blank line after the whole source file, it is ok.

      I think you may search a \n after // as the end of the comment, but if the comment locates at the last line of the file, it cause problem.

      ###@###.###

            gafter Neal Gafter (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: