I’ve made several attempts at getting package annotation @ParametersAreNonnullByDefault to work for me in a maven project but with no success.
Could someone share a link to a minimal/sample maven project where this is setup (or post the pom.xml and package-info.java and demo class)?
I’m talking about having findbugs processor enforce it for me.
How to apply
@ParametersAreNonnullByDefaultCreate a file
package-info.javain your package where you want to enforce the desired behavior.In that file, do the following:
How not to apply
@ParametersAreNonnullByDefaultDon’t do the following in a Java source file:
Declaring annotations like this is ambiguous.
Notes
It would be OK to apply the annotation directly on
Answerclass.The exact same things apply to
@ParametersAreNullableByDefaultalso.