Make language support nested comments

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.2, 1.3.1
    • Component/s: specification
    • generic, x86
    • generic, windows_nt



      Name: krT82822 Date: 10/29/99


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)


      Because the compiler does not support/parse nested comments properly, you can
      of course "hide" code by accident by mis-typing the comment terminator */ as
      just a * or a *?

      This can cause a LOT of difficult to find problems! See also Bug ID 4260488 and
      4191585 which are symptoms of the same problem.

      Please add proper parsing of nested comments, OR make /* and illegal sequence
      within a comment, so that the compiler will barf on code like the following
      (which works fine in 1.2.2 but it would be much nicer if it wouldn't compile)

      import java.lang.*;
      import java.io.*;

      public class bug
      {
        public static final void main( String[] args)
        {
          System.out.println( "Hey, it's a bug in the compiler, watch...");
          System.out.println( "If the bug occurs, you will NOT see a line after
      this");

          /* Now of course it is the following typo which causes a nested comment...
      *?

          System.out.println( "-----------------------------------------------------
      ");

          /* ...and now we have a comment terminator */

          System.out.println( "See, there was no line.");
          System.out.println( "");
          System.out.println( "I propose that you make /* an illegal sequence inside
      a comment block.");
        }
      }
      (Review ID: 97204)
      ======================================================================

            Assignee:
            Alex Buckley
            Reporter:
            Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: