A DESCRIPTION OF THE PROBLEM :
The current Javadoc tool documentation does not mention that generic methods may have its type parameters documented with @param tags similar to generic classes. This seems to be a feature that not many developers are aware of and IMHO worth to be documented.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class or method or constructor. Use angle brackets around this parameter name to specify the use of a type parameter, such as:
/**
* @param <E> Type of element stored in a list
*/
public interface List<E> extends <E> {
}
/**
* blah.
*
* @param <T> blah
* @param <V> blah
* @param string blah
* @param type blah
*
* @return blah
*/
<T, V extends T> V convert(String string, Class<T> type);
ACTUAL -
The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class. Use angle brackets around this parameter name to specify the use of a type parameter, such as:
/**
* @param <E> Type of element stored in a list
*/
public interface List<E> extends Collection<E> {
}
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#@param
###@###.### 2005-05-11 12:25:00 GMT
The current Javadoc tool documentation does not mention that generic methods may have its type parameters documented with @param tags similar to generic classes. This seems to be a feature that not many developers are aware of and IMHO worth to be documented.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class or method or constructor. Use angle brackets around this parameter name to specify the use of a type parameter, such as:
/**
* @param <E> Type of element stored in a list
*/
public interface List<E> extends <E> {
}
/**
* blah.
*
* @param <T> blah
* @param <V> blah
* @param string blah
* @param type blah
*
* @return blah
*/
<T, V extends T> V convert(String string, Class<T> type);
ACTUAL -
The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class. Use angle brackets around this parameter name to specify the use of a type parameter, such as:
/**
* @param <E> Type of element stored in a list
*/
public interface List<E> extends Collection<E> {
}
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#@param
###@###.### 2005-05-11 12:25:00 GMT