You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/12/12 06:13:20 UTC
[dubbo] branch 2.7.5-release updated: fix getColonSeparatedKey()
does not work in 'registry.simplified=true' mode. (#5465)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch 2.7.5-release
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/2.7.5-release by this push:
new 6fc6494 fix getColonSeparatedKey() does not work in 'registry.simplified=true' mode. (#5465)
6fc6494 is described below
commit 6fc6494da1a1f4ed3be4de3d836b3ee1eafae84c
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Dec 12 14:13:08 2019 +0800
fix getColonSeparatedKey() does not work in 'registry.simplified=true' mode. (#5465)
---
dubbo-common/src/main/java/org/apache/dubbo/common/URL.java | 2 +-
dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java b/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
index eac2e7b..5c29cda 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
@@ -1375,7 +1375,7 @@ class URL implements Serializable {
*/
public String getColonSeparatedKey() {
StringBuilder serviceNameBuilder = new StringBuilder();
- append(serviceNameBuilder, INTERFACE_KEY, true);
+ serviceNameBuilder.append(this.getServiceInterface());
append(serviceNameBuilder, VERSION_KEY, false);
append(serviceNameBuilder, GROUP_KEY, false);
return serviceNameBuilder.toString();
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
index 2f99f84..a5c0d98 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
@@ -719,6 +719,12 @@ public class URLTest {
URL url4 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName");
Assertions.assertEquals("org.apache.dubbo.test.interfaceName::", url4.getColonSeparatedKey());
+
+ URL url5 = URL.valueOf("10.20.130.230:20880/org.apache.dubbo.test.interfaceName");
+ Assertions.assertEquals("org.apache.dubbo.test.interfaceName::", url5.getColonSeparatedKey());
+
+ URL url6 = URL.valueOf("10.20.130.230:20880/org.apache.dubbo.test.interfaceName?interface=org.apache.dubbo.test.interfaceName1");
+ Assertions.assertEquals("org.apache.dubbo.test.interfaceName1::", url6.getColonSeparatedKey());
}
@Test