This is an automated email from the ASF dual-hosted git repository. iluo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push: new 897709b fix 4160 (#4163) 897709b is described below commit 897709b57c0a5edae3b3a1439d42116ea63df5b9 Author: kexianjun <kexianjun1...@hotmail.com> AuthorDate: Mon Aug 12 15:10:45 2019 +0800 fix 4160 (#4163) --- .../factory/annotation/ReferenceAnnotationBeanPostProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java index 834939a..7feea26 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java @@ -298,8 +298,10 @@ public class ReferenceAnnotationBeanPostProcessor extends AnnotationInjectedBean .interfaceClass(referencedType); referenceBean = beanBuilder.build(); referenceBeanCache.put(referencedBeanName, referenceBean); + } else if (!referencedType.isAssignableFrom(referenceBean.getInterfaceClass())) { + throw new IllegalArgumentException("reference bean name " + referencedBeanName + " has been duplicated, but interfaceClass " + + referenceBean.getInterfaceClass().getName() + " cannot be assigned to " + referencedType.getName()); } - return referenceBean; }