Skip to content

@Nullable prevents code from being compiled with -Werror #25095

Closed
@wilkinsona

Description

@wilkinsona

Affects: 5.2.6.RELEASE

Code that uses @Nullable cannot be compiled with -Werror due to the use of When.MAYBE on its @Nonnull meta-annotation. Attempting to compile code that depends on spring-core and that uses @Nullable results in a compilation failure:

warning: unknown enum constant When.MAYBE
  reason: class file for javax.annotation.meta.When not found
error: warnings found and -Werror specified
1 error
1 warning

Unfortunately, there's no way to suppress such warnings so I either have to abandon trying to compile with -Werror or I have to add a dependency on com.google.code.findbugs:jsr305:3.0.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions