Skip to content
Advertisement

Tag: findbugs

How to resolve findbug issue: Null passed for nonnull parameter

I’m getting the following findbugs error: “Method call passes null for nonnull parameter : Null passed for nonnull parameter of getApiStatus(ApiResponse)” If the apiResponse is null in the CallApi method (not shown here for brevity’s sake), it simply throws an exception that is caught in handleApiException and thrown again if we can’t do anything else about the exception. There is

How to suppress FindBugs warnings for fields or local variables?

I would like to suppress FindBugs warnings for specific fields or local variables. FindBugs documents that the Target can be Type, Field, Method, Parameter, Constructor, Package for its edu.umd.cs.findbugs.annotations.SuppressWarning annotation [1]. But it does not work for me to annotate the field, only when I annotate the method the warning gets suppressed. Annotating a whole method seems to broad to

Advertisement