Skip to content

Assert preconditions for MergedAnnotations.from() factory methods #25568

@sbrannen

Description

@sbrannen

If null values are supplied for the RepeatableContainers or AnnotationFilter arguments to from() factory methods in MergedAnnotations, certain operations will eventually result in a NullPointerException.

This is to be expected; however, the NullPointerException is often swallowed and only logged at INFO level with an exception message similar to the following.

Failed to introspect annotations on org.example.MyClass: NullPointerException

In such cases, the INFO log message is not helpful in diagnosing the problem. Furthermore, since the exception is swallowed, the desired operation (e.g., MergedAnnotations.stream(...)) simply returns no
results, and the user is left wondering what happened.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions