in my team we use checkstyle to improve our coding standards, but now we came across a rule which could be improved.
The Empty Block rule gives us a warning about an empty catch block (without java code and without comment), but with the standard configuration it generates also a warning if the block contains a comment.
e.g.
The two should not result a warning:
try {
// some code
} catch (NumberFormatException ignore) {
// ignore
}
try {
// some code
} catch (NumberFormatException e) {
logger.debug("some debug");
}
This should result a warning:
try {
// some code
} catch (NumberFormatException ignore) {
}
How can we improve checkstyle to give us only a warning, if no comment and no java code is in the catch block?
I looked for a solution, but I stackoverflow and google didn't have any.
Can someone help me?