Name: nt126004 Date: 11/09/2001
C:\>java -version
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)
If the javadoc documentation of a method contains multiple @throws tag for the
same exception, only the first @throws tag is used and the others (of the same
exception) are ignored.
Follow these steps to reproduce the problem:
1. create a Test.java file containing the following source:
public class Test {
/**
* A test method.
* <p>
* @throws IllegalArgumentException If a occurs.
* @throws IllegalArgumentException If b occurs.
*/
public void test() {}
}
2. Generate the html files using the javadoc tool:
javadoc Test.java
3. Take a look at the generated html files and notice that only the first
exception is declared in the html documentation. This is the relevant section
of the html code:
<A NAME="test()"><!-- --></A><H3>
test</H3>
<PRE>
public void <B>test</B>()</PRE>
<DL>
<DD>A test method.
<p>
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - If a occurs.</DL>
</DD>
</DL>
As you can see, only the first @throws tag is included. The second one is
ignored.
Also note that this problem does NOT occur when I use JDK 1.3.1_01a
Maarten
(Review ID: 135271)
======================================================================