You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The null check in spring 5 was removed. In my project a bean is returning null. It is marked as Nullable, nevertheless the container startup fails due to a NPE at line 109 in AnnotationAwareOrderComparator of 5.0.3.
I suppose this happens within DefaultListableBeanFactory.determineHighestPriorityCandidate, for a bean instance that happens to resolve to null? We could also defensively bypass the entire getPriority call for null values at that level.
Exactly. The bean is annotated with @Nullable, also on the inject side it is annoted with @Nullable. If only 1 possibly matching bean exists than all is good, but as soon as more than 1 probably matching bean exists above code is executed and throws a NPE.
Uh oh!
There was an error while loading. Please reload this page.
Mario Hochreiter opened SPR-16508 and commented
The null check in spring 5 was removed. In my project a bean is returning null. It is marked as Nullable, nevertheless the container startup fails due to a NPE at line 109 in AnnotationAwareOrderComparator of 5.0.3.
Code in 4.3.12:
Now in 5.0.3:
Affects: 5.0.3
Issue Links:
Referenced from: commits c9d08bf
The text was updated successfully, but these errors were encountered: