This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 376443a  [3.0] Fix seata get version and group fail (#7445)
376443a is described below

commit 376443af053254e6bf4ebd497d661952f01e2aef
Author: Albumen Kevin <[email protected]>
AuthorDate: Fri Mar 26 10:14:50 2021 +0800

    [3.0] Fix seata get version and group fail (#7445)
    
    * Fix seata get version and group fail
    
    * clean up code
---
 .../java/org/apache/dubbo/config/spring/ReferenceBean.java   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
 
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
index 67a38e5..a3a4c50 100644
--- 
a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
+++ 
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
@@ -16,6 +16,7 @@
  */
 package org.apache.dubbo.config.spring;
 
+import org.apache.dubbo.common.constants.CommonConstants;
 import org.apache.dubbo.common.utils.Assert;
 import org.apache.dubbo.common.utils.ReflectUtils;
 import org.apache.dubbo.common.utils.StringUtils;
@@ -24,6 +25,7 @@ import org.apache.dubbo.config.support.Parameter;
 import org.apache.dubbo.config.utils.ReferenceConfigCache;
 import org.apache.dubbo.rpc.proxy.AbstractProxyFactory;
 import org.apache.dubbo.rpc.support.ProtocolUtils;
+
 import org.springframework.aop.framework.ProxyFactory;
 import org.springframework.aop.target.AbstractLazyCreationTargetSource;
 import org.springframework.beans.MutablePropertyValues;
@@ -140,12 +142,16 @@ public class ReferenceBean<T> implements FactoryBean,
     }
 
     /* Compatible with seata: 
io.seata.rm.tcc.remoting.parser.DubboRemotingParser#getServiceDesc() */
+    @Deprecated
     public String getGroup() {
-        return referenceConfig.getGroup();
+        Object version = propertyValues.get(CommonConstants.GROUP_KEY);
+        return version == null ? null : String.valueOf(version);
     }
 
+    @Deprecated
     public String getVersion() {
-        return referenceConfig.getVersion();
+        Object version = propertyValues.get(CommonConstants.VERSION_KEY);
+        return version == null ? null : String.valueOf(version);
     }
 
     public Map<String, Object> getReferenceProps() {
@@ -216,7 +222,7 @@ public class ReferenceBean<T> implements FactoryBean,
         for (Class<?> anInterface : internalInterfaces) {
             proxyFactory.addInterface(anInterface);
         }
-        if (ProtocolUtils.isGeneric(generic)){
+        if (ProtocolUtils.isGeneric(generic)) {
             //add actual interface
             proxyFactory.addInterface(ReflectUtils.forName(interfaceName));
         }

Reply via email to