Reading the CheckStyle documentation for the Check JavadocMethod I do not understand the property logLoadErrors.
There we are told
This check may need to load exception classes mentioned in the @throws tag to check whether they are RuntimeExceptions. If loading the class fails, this property allows to control checkstyle's error handling. If set to false a classpath configuration problem is assumed and the TreeWalker stops operating on the class completely. If set to true (the default) , checkstyle assumes a typo or refactoring problem in the javadoc and logs the problem in the normal checkstyle report (potentially masking a configuration error).
Furthermore the property suppressLoadErrors is described as follows:
When logLoadErrors is set to true, the TreeWalker completely processes a class and displays any problems with loading exceptions as checkstyle violations. When this property is set to true, the violations generated when logLoadErrors is set true are suppressed from being reported as violations in the checkstyle report.
My first thought was that on standard configuration logLoadErrors = true, suppressLoadErrors = false CheckStyle gives a warning if an Exception class mentioned in the @throws tag is not found. I tried this example:
/**
* Returns if the first of two given numbers is smaller than the other one.
* @param a Description param a
* @param b Description param b
* @throws Exception bla
* @throws MyException foo
*/
public boolean javadocMethod(int a, int b) throws Exception, MyException {
return a < b;
}
I thought I would get a warning on running CheckStyle because the class MyException does not exist. But I don't get any warning. Can some provide another example?