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: 4693440
Votes 0
Synopsis Does not warn when first argument of @param is not parameter name
Category doclet:tbd
Reported Against 1.4
Release Fixed 1.4.2(mantis)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 30-MAY-2002
Description
I have fixed this bug.  When a bad parameter name is passed to @param, the following warning is printed:

@param argument "paramName" is not a parameter name.

When @param is used more than once for the same parameter, the following warning is printed:

 Parameter "paramName" is documented more than once.

 xxxxx@xxxxx  2002-07-18




FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

FULL OPERATING SYSTEM VERSION :win 2000


A DESCRIPTION OF THE PROBLEM :
Running javadoc 1.4 on below program does not generate
@params (see source code below)


REGRESSION.  Last worked in version 1.3

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.cut and a paste the source code into test.java
2.get into jdk 1.4 environment
3.do javadoc test.java and see the output

EXPECTED VERSUS ACTUAL BEHAVIOR :
The expected result should be like result of jdk1.3
javadoc.

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class test
{
  /**
   * Show the problem with javadoc 1.4.
   * Javadoc 1.4 does not generate the @param.
   *
   * @param String -name
   * @param int -age
   * @return boolean -true is age is less than 13, false otherwise.
  */
  public int test(String name, int age)
    throws Exception
  {
    if ( age < 13 ) return true;
    return false;
  }
}
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Have not find one yet.

Release Regression From : 1.3.1_03
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 147172) 
======================================================================
Work Around
N/A
Evaluation
What is happening here is that starting with 1.4.0, the @param tag requires 
its first argument to be the parameter name.  In this case, the user has 
specified the parameter type instead.

Prior to 1.4.0, the test method parameters were documented as:

Parameters:
            name - -String
            age - -int

With 1.4.1, however, the Parameters heading and entries are missing altogether,
with no warning.  Javadoc should print a warning when the parameter
name specified by @param does not appear in the declaration's 
parameter list.  

Suggest a warning such as (of course, the filename and line number
should be included):

   warning: @param argument "String" is not a parameter name

Committed to mantis.

Changed synopsis from:
  javadoc does not generate @param
to this:
  Does not generate @param when its first arg is not parameter name

 xxxxx@xxxxx  2002-05-30

Changed synopsis from:
  Does not generate @param when its first arg is not parameter name
to this:
  Does not warn when first argument of @param is not parameter name

Removed "REGRESSION" from synopsis, as not generating @param when there
is a mismatch is a new feature.

 xxxxx@xxxxx  2002-05-31

This bug fix should also handle the case where there is an extra @param
tag listed, as the first arg to @param would not correspond to a parameter name.
This was discussed on the Javadoc Forum subject "@param".  For example:

public class ParamBug {

   /**
    * Space pad a String.
     @param S String to pad.
     @param length Desired minimum length.
     @param end Should the padding be at the end.
     @param extra the extra param
    */
    public static String pad(String S, int length, boolean end) {
    }
}


 xxxxx@xxxxx  2002-05-31

I have fixed this bug. The bug fix is pending review.
 xxxxx@xxxxx  2002-07-08
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang