I have had 'hidden' bugs due to Eclipse not reporting 'unused' variables because they were used in an assertion (precondition), for example:
public void method(final String text, ...other parameters) {
assert StringUtils.isNotBlank(text);
...
// The text variable is never used in the method.
// If Eclipse had reported the variable as 'unused' I would have noticed that something is wrong with the code.
...
}
I would like to tell Eclipse to ignore assertions when checking for unused variables. I doubt anyone would pass a parameter to only run an assertion on it... Also let me know if FindBugs or another tool can do this.