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

REGRESSION: documentation comment with @deprecated tag

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b46
    • CPU:
      generic, sparc
    • OS:
      solaris_8
    • Verification:
      Verified

      Description



      Name: ngR10089 Date: 02/26/2004


       
      JLS, 2nd ed. doesn't contain documentation comment definition.
      About traditional comment it says in 3.7 'Comments':

          "A traditional comment: all the text from the ASCII
           characters /* to the ASCII characters */ is ignored
           (as in C and C++)."

      However the compiler (jdk1.5.0-b40) reports an error when compiles
      documentation comments with @deprecated tag.
      The test below reproduces the problem.

      > java -version
      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b40)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b40, mixed mode)

      > javac -d . test.java
      jac -d . test.java
      test.java:6: modifier deprecated not allowed here
          int iAdd1 (/** @deprecated comment's */ int j) {
                                                    ^
      test.java:26: modifier deprecated not allowed here
              } catch (Exception e) {
                       ^
      2 errors

      >

      ----------------- test.java -----------------
      package p;

      import java.io.PrintStream;

      class Alex01020m1 {
          int iAdd1 (/** @deprecated comment's */ int j) {
              return j + 1;
          }
      }
      public class test {
          public static void main(String args[]) {
              System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
          }
          public static int run(String args[], PrintStream out) {
              /**
              * @deprecated "comment's wrong place for javadoc"
              */
              Alex01020m1 x = new Alex01020m1 ();
              try {
                  /**
                  * @deprecated comment's wrong place for javadoc
                  */
                  if ( x.iAdd1(1) == 2) {
                      return 0/*STATUS_PASSED*/;
                  }
              } catch (Exception e) {
              }
              return 2/*STATUS_FAILED*/;
          }
      }
      ---------------------------------------------

      The restored JCK test
        lang/LEX/lex010/lex01020m1/lex01020m1.html
      fails due to this bug.
      This test exists in JCK-13a and is restoring in jck15.

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gafter Neal Gafter
              Reporter:
              nvgsunw Nvg Nvg (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: