JDK-4366537 : stddoclet: Javadoc inherits @throws comments when it shouldn't
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.3.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-08-29
  • Updated: 2020-08-31
  • Resolved: 2000-12-09
Related Reports
Duplicate :  
Description
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) 
======================================================================

Comments
EVALUATION Dupe of 4317583. I've copied this example there and closed this out as a dupe. doug.kramer@Eng 2000-12-08
08-12-2000