FindBugs and Concurrency annotations?

Help
2010-11-08
2013-02-05
  • Walter Prager
    Walter Prager
    2010-11-08

    I'm trying to use the jcip.jar annotations described in Java Concurrency in Practice.  According to the documentation FIndBugs 1.3.9 supports them.  To test things our I added a @GuardedBy("this") to the declaration of some class variables and ran FindBugs against another class which accesses these fields without any synchronization.  Even with the output set to low I got absolutely nothing.  I also tried to synchronize access to the field using a different Object (not "this") but that did not produce anything either.

    Is this *not* how it is supposed to work?  I thought that, if I explicitly stated that a particular field was guarded by "this" then FindBugs would alert me to any unguarded access, or access guarded by a different lock object.