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

javadoc allows over-riding final methods.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • tools

      Consider the following two files, test.java and second.java.
      ------------------------------------------------------------

      jtools-sqe:/home/vr128054/vertest/work 259 % more test.java
      public class test
      {
              public final void doNothing ()
              {
              }
      }

       
      jtools-sqe:/home/vr128054/vertest/work 260 % more second.java
      public class second extends test
      {
              public void doNothing ()
              {
              }
      }


      Find the compiler's behaviour when tried to compile..
      -----------------------------------------------------
      jtools-sqe:/home/vr128054/vertest/work 261 % javac *.java
      second.java:3: doNothing() in second cannot override doNothing() in test; overridden method is final
              public void doNothing ()
                          ^
      1 error

      Find Javadoc's behaviour below.
      -------------------------------

      jtools-sqe:/home/vr128054/vertest/work 262 % javadoc *.java
      Loading source file second.java...
      Loading source file test.java...
      Constructing Javadoc information...
      Standard Doclet version 1.4 beta (04 Aug 2001)

      Building tree for all the packages and classes...
      Building index for all the packages and classes...
      Generating overview-tree.html...
      Generating index-all.html...
      Generating deprecated-list.html...
      Building index for all classes...
      Generating allclasses-frame.html...
      Generating allclasses-noframe.html...
      Generating index.html...
      Generating packages.html...
      Generating second.html...
      Generating test.html...
      Generating package-list...
      Generating help-doc.html...
      Generating stylesheet.css...

      Javadoc should not accept these classes. Should throw an error.

            gafter Neal Gafter (Inactive)
            rvijayansunw Ra Vijayan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: