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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      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.

      ###@###.###

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: