in my team we use checkstyle to improve our coding standards, but now we are faced with a rule that can be improved.
The Empty Block rule gives us a warning about an empty catch block (without java code and no comment), but with a standard configuration, it also generates a warning if the block contains a comment.
eg.
Both should not cause warnings:
try { // some code } catch (NumberFormatException ignore) { // ignore } try { // some code } catch (NumberFormatException e) { logger.debug("some debug"); }
This will result in a warning:
try { // some code } catch (NumberFormatException ignore) { }
How can we improve checkstyle to give us only a warning if there is no comment and no java code in the catch block?
I was looking for a solution, but stackoverflow and google didn't have one.
Can someone help me?
source share