|
Quick Lists
|
|
Bug ID:
|
4317583
|
|
Votes
|
0
|
|
Synopsis
|
stddoclet: Inherited @throws improperly copies from overridden method to subclas
|
|
Category
|
doclet:tbd
|
|
Reported Against
|
1.3
, 1.4
, 1.2.2
, 3.1.1
, kestrel
, kestrel-rc1
, kest-sol-fcs
|
|
Release Fixed
|
1.4(merlin-beta2)
|
|
State
|
10-Fix Delivered,
Verified,
bug
|
|
Priority:
|
4-Low
|
|
Related Bugs
|
4317026
,
4366537
,
4378067
,
4679573
|
|
Submit Date
|
29-FEB-2000
|
|
Description
|
When an overriding method's doc comment doesn't contain any javadoc tags,
the standard doclet copies the javadoc tags from the overridden methods
doc comment in the superclass. In some cases, this results in copying
@throws tags to the overriding method in the subclass when the subclass's
method doesn't throw any exceptions.
An example of this is the java.io.PrintWriter.write(int) spec.
http://webwork.eng/products/jdk/1.3/docs/api/java/io/PrintWriter.html#write(int)
PrintWriter.write(int) overrides Writer.write(int), and PrintWriter.write's spec copies the @throws IOException tag from Writer.write's spec. However, this is
not appropriate since PrintWriter.write does not throw IOException.
The standard doclet should not blindly copy javadoc tags, or at least @throws
tags, to the overriding class's spec.
This problem is present in 1.2.2 and 1.3.
|
|
Work Around
|
This problem can be avoided by adding some javadoc tags to the overriding
method's doc comments so that no tags are copied from the overridden class.
|
|
Evaluation
|
This causes the spec to be wrong.
We need to consider how to fix this.
xxxxx@xxxxx 2000-09-07
This is closely related to RFE 4186639, which asks for @inheritdoc tag
to explicitly inherit documentation. I do not consider them dupes and
am keeping them separate since one is a bug and the other a feature
request. This bug is more pressing to fix, and may be the impetus
for the RFE to be implemented.
xxxxx@xxxxx 2000-11-15
The doclet no longer copies throw tags from overridden methods. (Merlin Beta 2)
The user will be able to explicitely inherit the documentation when RFE 4816639
is implemented.
Location of fix:
MethodSubWriter.java
xxxxx@xxxxx 2001-05-29
The behaviour of @throws tag inheritence has been improved. We now allow @throws tags for declared exceptions to be inherited from the overriden or implemented method. (Merlin Beta 3)
Location of fix:
com/sun/tools/doclets/standard/tags/ThrowsTaglet.java
xxxxx@xxxxx 2001-09-06
|
|
Comments
|
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |