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

stddoclet: Javadoc inherits @throws comments when it shouldn't

XMLWordPrintable

      Name: skT45625 Date: 08/28/2000
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      Javadoc generates documentation that inherits @throws comments from classes and
      interfaces even if the documented exceptions aren't thrown in the
      extending/implementing class.

      public class A {
      /** @throws Exception if we feel like it */
      public void foo() throws Exception {
      throw new Exception();
      }
      }

      interface I {
      /** @throws Exception from time to time */
      public void bar() throws Exception;
      }

      public class B extends A implements I {
      public void foo() {
      }
      public void bar() {
      }
      }

      The documentation for B will include throws comments for foo and bar, even
      though B doesn't declare foo and bar to throw any exceptions.
      (Review ID: 108967)
      ======================================================================

            dkramersunw Douglas Kramer (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: