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 03:41:58 UTC

[dubbo] branch simplified-url-interface created (now 8c0632c)

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

liujun pushed a change to branch simplified-url-interface
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


      at 8c0632c  fix getColonSeparatedKey() does not work in 'registry.simplified=true' mode.

This branch includes the following new commits:

     new 8c0632c  fix getColonSeparatedKey() does not work in 'registry.simplified=true' mode.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[dubbo] 01/01: fix getColonSeparatedKey() does not work in 'registry.simplified=true' mode.

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch simplified-url-interface
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 8c0632cbbe8232f87fadf0d4119d8e480d541aa7
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Dec 12 11:41:29 2019 +0800

    fix getColonSeparatedKey() does not work in 'registry.simplified=true' mode.
---
 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