Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assert preconditions for MergedAnnotations.from() factory methods
Prior to this commit, if null values were supplied for the RepeatableContainers or AnnotationFilter arguments to `from()` factory methods in MergedAnnotations, certain operations would 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. This commit improves the user experience by eagerly asserting non-null preconditions for required arguments in MergedAnnotations.from() factory methods. Closes gh-25568
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters