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

JavaDoc comments throw off javac line numbers

XMLWordPrintable

    • beta2
    • generic, x86
    • generic, windows_nt, windows_2000
    • Verified



      Name: bsC130419 Date: 05/25/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)


      JavaDoc comments in Java source file throw off line and column values used by
      javac for error reporting and class file debug info. It seems every JavaDoc
      comment line adds one too many lines to the overall line count.


      /**
       * Each line in JavaDoc comment throws off javac line numbers in
       * both error reporting and class file generation.
       */
      public class JavacBug {
          void a(String i) {
              i++;
          }
      }//------|


      When compiled, produces the result:


      JavacBug.java:9: operator ++ cannot be applied to java.lang.String
      }//------|
               ^
      1 error


      The actual error is on line 7, not 9.
      (Review ID: 125044)
      ======================================================================

            gafter Neal Gafter (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: