我有一个遗留的Java应用程序,其中复制了许多javadoc或只存在方法javadoc的空模板。
我想使用一个工具来清理那些空的和多余的JavaDoc注释。
以下是更好理解的示例。当然,对于继承的方法存在同样的问题。
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);
}
这是一个实现此接口并使用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;
}
}
我正在使用maven和eclipse,但是赞赏任何工具或提示/帮助 非常感谢。