Closed
Description
Andy Wilkinson opened SPR-13759 and commented
The javadoc states that:
The findAnnotatedBeans(ApplicationContext) method can be used to discover such beans. However, a ControllerAdviceBean may be created from any object, including ones without an
@ControllerAdvice
.
However, the implementation says otherwise:
ControllerAdvice annotation = AnnotationUtils.findAnnotation(beanType, ControllerAdvice.class);
if (annotation == null) {
throw new IllegalArgumentException(
"Bean type [" + beanType.getName() + "] is not annotated as @ControllerAdvice");
}
Affects: 4.1.8, 4.2.3
Referenced from: commits d64ac32, 6963e27
Backported to: 4.1.9