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:
public Integer getPriority(Object obj) {
Integer priority = null;
if (obj instanceof Class) {
priority = OrderUtils.getPriority((Class<?>) obj);
}
else if (obj != null) {
priority = OrderUtils.getPriority(obj.getClass());
if (priority == null && obj instanceof DecoratingProxy) {
priority = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());
}
}
return priority;
}
Now in 5.0.3:
public Integer getPriority(Object obj) {
if (obj instanceof Class) {
return OrderUtils.getPriority((Class<?>) obj);
}
Integer priority = OrderUtils.getPriority(obj.getClass());
if (priority == null && obj instanceof DecoratingProxy) {
priority = OrderUtils.getOrder(((DecoratingProxy) obj).getDecoratedClass());
}
return priority;
}
Affects: 5.0.3
Issue Links:
Referenced from: commits c9d08bf
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