Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.qq.tars.spring.annotation.TarsServant;
import org.springframework.aop.framework.Advised;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.AnnotatedElementUtils;

import java.util.Map;

Expand Down Expand Up @@ -93,7 +93,7 @@ private ServantHomeSkeleton loadServant(Object bean) throws Exception {

ServerConfig serverCfg = ConfigurationManager.getInstance().getServerConfig();

homeName = AnnotationUtils.getAnnotation(bean.getClass(), TarsServant.class).name();
homeName = AnnotatedElementUtils.findMergedAnnotation(bean.getClass(), TarsServant.class).name();
if (StringUtils.isEmpty(homeName)) {
throw new RuntimeException("servant name is null.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.qq.tars.spring.annotation.TarsClient;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.util.ReflectionUtils;

import java.lang.reflect.Field;
Expand All @@ -51,7 +51,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) throw

private void processFields(Object bean, Field[] declaredFields) {
for (Field field : declaredFields) {
TarsClient annotation = AnnotationUtils.getAnnotation(field, TarsClient.class);
TarsClient annotation = AnnotatedElementUtils.findMergedAnnotation(field, TarsClient.class);
if (annotation == null) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.SmartLifecycle;
import org.springframework.core.annotation.AnnotatedElementUtils;

import java.io.IOException;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -152,7 +153,7 @@ private ServantHomeSkeleton loadServant(Object bean) throws Exception {

ServerConfig serverCfg = ConfigurationManager.getInstance().getServerConfig();

homeName = bean.getClass().getAnnotation(TarsServant.class).name();
homeName = AnnotatedElementUtils.findMergedAnnotation(bean.getClass(), TarsServant.class).name();
if (StringUtils.isEmpty(homeName)) {
throw new RuntimeException("servant name is null.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.util.ReflectionUtils;

import java.lang.reflect.Field;
Expand Down Expand Up @@ -75,7 +75,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) throw

private void processFields(Object bean, Field[] declaredFields) {
for (Field field : declaredFields) {
TarsClient annotation = AnnotationUtils.getAnnotation(field, TarsClient.class);
TarsClient annotation = AnnotatedElementUtils.findMergedAnnotation(field, TarsClient.class);
if (annotation == null) {
continue;
}
Expand Down