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.
If
nullvalues are supplied for theRepeatableContainersorAnnotationFilterarguments tofrom()factory methods inMergedAnnotations, certain operations will eventually result in aNullPointerException.This is to be expected; however, the
NullPointerExceptionis often swallowed and only logged atINFOlevel with an exception message similar to the following.In such cases, the
INFOlog message is not helpful in diagnosing the problem. Furthermore, since the exception is swallowed, the desired operation (e.g.,MergedAnnotations.stream(...)) simply returns noresults, and the user is left wondering what happened.