Monits/findbugs-plugin

False positive caling a method @VisibleForTesting from @Before or other method

Closed this issue · 1 comments

pabad commented

When calling a method of a class that has been annotated with guava's @VisibleForTesting, the plugin reports a warning (FB.W.GUAVA_UNEXPECTED_ACCESS_TO_VISIBLE_FOR_TESTING) if the method is being call from outside a test method.

This casues problems when:

  1. We call the method as part of building the text fixture from a @before method
  2. We call the method as part of a helper method building test objects, called from either a setup method or an actual test method

b37d82c should fix this, check with version 0.1.1 of the plugin.