Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v1.7.x' into v1.7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
p_huityu committed Oct 30, 2022
2 parents 7c7949b + dbb5d52 commit 30020e7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<brave-opentracing.version>0.31.1</brave-opentracing.version>
<zipkin-reporter.version>2.7.4</zipkin-reporter.version>
<ch.qos.logback.version>1.2.3</ch.qos.logback.version>
<gson.version>2.8.6</gson.version>
<gson.version>2.8.9</gson.version>
</properties>

<dependencies>
Expand Down
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

0 comments on commit 30020e7

Please sign in to comment.