Assert.notNull(bean, "Bean must not be null");
this.bean = bean;
this.order = initOrderFromBean(bean);
Class<?> beanType = bean.getClass();
ControllerAdvice annotation = AnnotationUtils.findAnnotation(beanType,ControllerAdvice.class);
Assert.notNull(annotation, "Bean type [" + beanType.getName() + "] is not annotated @ControllerAdvice");
this.basePackages.addAll(initBasePackagesFromBeanType(beanType, annotation));
this.annotations.addAll(Arrays.asList(annotation.annotations()));
this.assignableTypes.addAll(Arrays.asList(annotation.assignableTypes()));
this.beanFactory = null;
}