Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4778311
Votes 0
Synopsis stddoclet: @param in base class is ignored if {@inheritDoc} in main description
Category doclet:tbd
Reported Against 1.4.1
Release Fixed
State 6-Fix Understood, bug
Priority: 4-Low
Related Bugs
Submit Date 13-NOV-2002
Description




FULL PRODUCT VERSION :
C:\Java>java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)


FULL OPERATING SYSTEM VERSION : Windows ME


A DESCRIPTION OF THE PROBLEM :
@param tag in the sub class is ignored.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Try to generate a javadoc with the sample above
2.
3.

EXPECTED VERSUS ACTUAL BEHAVIOR :
@param tag in the sub class should be reflected in a
generated HTML file. But @para tag in the base class is
copied into the generated HTML files.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
abstract class InheritDocBase {
    /**
     * Return the last name of persons whose first name is matched.
     *
     * @param   firstName firstName to be searched
     * @return  array of last names
     * @throws  java.lang.Exception name not found
     */
     public abstract String[] geLastName(String firstName) throws Exception;
}


class InheritDocSub extends InheritDocBase {
    /**
     * Based on the address book, {@inheritDoc}
     *
     * @param   firstName first Name to be searched from the address book.
     */
     public abstract String[] geLastName(String firstName) throws Exception;
}
---------- END SOURCE ----------
(Review ID: 166857) 
======================================================================




DESCRIPTION OF THE PROBLEM :
Using {@inheritDoc} in a method comment overrides the @param
tag.

The {@inheritDoc} should only add text, not override any,
and it shouldn't affect tags that don't contain it.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. javadoc SuperClass.java SubClass.java

EXPECTED VERSUS ACTUAL BEHAVIOR :
SubClass METHOD DETAIL contents:

expected:
Parameters:
bar - subclass doc bar

actual:
Parameters:
bar - superclass doc bar

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class SuperClass {
        /**
         * First sentence from superclass.  Second sentence from superclass.
         * @param bar superclass doc bar
         */
        public void foo( int bar ) {}
}

public class SubClass extends SuperClass {
        /**
         * {@inheritDoc} First sentence from subclass.  Second sentence from
subclass.
         * @param bar subclass doc bar
         */
        public void foo( int bar ) {}
}

---------- END SOURCE ----------


(Review ID: 181838)
======================================================================
Work Around
N/A
Evaluation
I am able to reproduce this bug.  The @param text in the subclass should
appear in the generated HTML for the subclass, but does not.  The @param
text for the base class appears instead.  This is a bug, as this should
happen only if the subclass either has no @param text or has 
"@param {@inheritDoc}".

Changed synopsis from:
  @param tag is not handled correctly

  @param in base class is ignored if {@inheritDoc} in main description

  xxxxx@xxxxx   2002-11-13

Yoshiki wrote:
But, I think, the bug is not a big problem, because usually 
the contract of a supertype  must be met in any subtype and
explanations of parameters will not be altered in a subtype.

  xxxxx@xxxxx   2002-11-13
Comments
  
  Include a link with my name & email   

Submitted On 28-OCT-2005
xdcx11
I found this bug referenced in the What's new in Javadoc 1.5 page (http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/whatsnew-1.5.0.html). However with jdk1.5.0_04 this appears to be fixed.



PLEASE NOTE: JDK6 is formerly known as Project Mustang