In my junit 4 test code I am using test rules that contain code like this:
catch (Throwable t) {
t.printStackTrace();
throw t;
}
Findbugs complains about this, and rightfully so - this should not be done in our production code. In this instance, however, I think the usage is justified, and I try to use the @SuppressFBWarnings annotation to silence findbugs. However, neither
@SuppressFBWarnings
private void warmUp() throws Throwable {
nor
@SuppressFBWarnings("IMC_IMMATURE_CLASS_PRINTSTACKTRACE")
private void warmUp() throws Throwable {
nor
@SuppressFBWarnings({"IMC_IMMATURE_CLASS_PRINTSTACKTRACE"})
private void warmUp() throws Throwable {
have the desired result.
How do I use @SuppressFBWarnings correctly to surpress the warning?