fix[proxy]: the annotations of the bean of the parent class cannot be scanned

This commit is contained in:
sun
2023-01-16 19:11:19 +08:00
parent e2522ac333
commit 06f716feb9
5 changed files with 6 additions and 28 deletions
@@ -43,15 +43,11 @@ public class EventRegisterProcessor implements BeanPostProcessor {
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
var clazz = bean.getClass();
var methods = ReflectionUtils.getMethodsByAnnoInPOJOClass(clazz, EventReceiver.class);
var methods = ReflectionUtils.getMethodsByAnnotation(clazz, EventReceiver.class);
if (ArrayUtils.isEmpty(methods)) {
return bean;
}
if (!ReflectionUtils.isPojoClass(clazz)) {
logger.warn("事件注册类[{}]不是POJO类,父类的事件接收不会被扫描到", clazz);
}
try {
for (var method : methods) {
var paramClazzs = method.getParameterTypes();