I have a legacy java application where many javadocs are duplicated or just the empty template of a method javadoc is present.
I would like to use a tool to clean up those empty and superfluous JavaDoc comment.
Here is an example for a better understanding. Same Problem exists for inherited methods of course.
public interface BaseIfc {
/**
* This is the javadoc comment written in the interface.
* @param myParameter the parameter description
* @return the return value description
* @throws Exception definition of the exception
*/
public int myInterfaceMethod(final String myParameter) throws Exception;
/**
* Another javadoc comment in the interface
* @param myClass the myClass parameter
* @return the return value description
*/
public String myOtherInterfaceMethod(final Class myClass);
}
Here is a class implementing this interface and doing wrong things with the JavaDoc:
public class BaseClass implements BaseIfc {
// same javadoc as in BaseIfc, should be removed
/**
* This is the javadoc comment written in the interface.
* @param myParameter the parameter description
* @return the return value description
* @throws Exception definition of the exception
*/
@Override
public int myInterfaceMethod(String myParameter) throws Exception {
return 0;
}
// different javadoc should stay
/**
* Own javadoc !
* @param myClass special information for parameter
*/
public String myOtherInterfaceMethod(Class myClass) {
return null;
}
// this is just the javadoc template with no information so should be removed
/**
*
* @param myIntParam
* @return
* @throws Exception
*/
private String ownUndocumentedMethod(int myIntParam) throws Exception {
return "";
}
// complete empty blocks should be removed as well
/**
*
*
*
*/
private int anotherUndocumentedMethod( int myIntParam ) {
return 0;
}
}
I am using maven and eclipse, but any tool or hint / help is appreciated.
Thanks a lot in advance.