1

I've tagged a method in my code with javax.annotation.CheckForNull and use it, without checking for null, in another place. When I run this code through FindBugs in Eclipse (via the plugin), there is no warning though.

Assuming there should be a warning (if not, what's a good test case?), why is it not showing?

It does show other warnings, not related to annotations.

Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301

2 Answers2

1

I think the answer you're looking for can be found in here: Findbugs using jsr305 annotations in eclipse is not finding bugs

(try running findbugs outside of eclipse)

Community
  • 1
  • 1
leifg
  • 8,668
  • 13
  • 53
  • 79
0

I just tested (Windows, Eclipse Helios, latest plugin) and it worked, warning of possible dereferencing of a null variable.

Perhaps check if this warning is not deactivated in your settings.

[EDIT] Tested with both javax.annotation.CheckForNull and edu.umd.cs.findbugs.annotations.CheckForNull, and both in the same class and in a class in a different package.

PhiLho
  • 40,535
  • 6
  • 96
  • 134