[dubbo] branch master updated: compatible with lower versions registering "default." keys (#5950)

2020-04-02 Thread liujun
This is an automated email from the ASF dual-hosted git repository.

liujun 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 abd6e36  compatible with lower versions registering "default." keys 
(#5950)
abd6e36 is described below

commit abd6e36991390a95fa0b3094249eb860c3ea6dd5
Author: ken.lj 
AuthorDate: Fri Apr 3 12:38:28 2020 +0800

compatible with lower versions registering "default." keys (#5950)
---
 dubbo-common/src/main/java/org/apache/dubbo/common/URL.java |  9 -
 .../java/org/apache/dubbo/common/utils/UrlUtilsTest.java| 13 +
 2 files changed, 21 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 1b90e37..e82cd63 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
@@ -43,6 +43,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.ANYHOST_VALUE;
 import static 
org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
+import static 
org.apache.dubbo.common.constants.CommonConstants.DEFAULT_KEY_PREFIX;
 import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.HOST_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.INTERFACE_KEY;
@@ -250,7 +251,13 @@ class URL implements Serializable {
 if (part.length() > 0) {
 int j = part.indexOf('=');
 if (j >= 0) {
-parameters.put(part.substring(0, j), part.substring(j 
+ 1));
+String key = part.substring(0, j);
+String value = part.substring(j + 1);
+parameters.put(key, value);
+// compatible with lower versions registering 
"default." keys
+if (key.startsWith(DEFAULT_KEY_PREFIX)) {
+
parameters.putIfAbsent(key.substring(DEFAULT_KEY_PREFIX.length()), value);
+}
 } else {
 parameters.put(part, part);
 }
diff --git 
a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java 
b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
index a116c69..a29c8e9 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
@@ -363,4 +363,17 @@ public class UrlUtilsTest {
 assertTrue(UrlUtils.isMatchGlobPattern("v*e", "value"));
 assertTrue(UrlUtils.isMatchGlobPattern("$key", "value", 
URL.valueOf("dubbo://localhost:8080/Foo?key=v*e")));
 }
+
+@Test
+public void testIsMatchUrlWithDefaultPrefix() {
+URL url = 
URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?default.version=1.0.0=test");
+assertEquals("1.0.0", url.getParameter("version"));
+assertEquals("1.0.0", url.getParameter("default.version"));
+
+URL consumerUrl = 
URL.valueOf("consumer://127.0.0.1/com.xxx.XxxService?version=1.0.0=test");
+assertTrue(UrlUtils.isMatch(consumerUrl, url));
+
+URL consumerUrl1 = 
URL.valueOf("consumer://127.0.0.1/com.xxx.XxxService?default.version=1.0.0=test");
+assertTrue(UrlUtils.isMatch(consumerUrl, url));
+}
 }



[dubbo-go] branch develop updated: Mod: README.md

2020-04-02 Thread joezou
This is an automated email from the ASF dual-hosted git repository.

joezou pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
 new 487c8b7  Mod: README.md
 new 6c0afbe  Merge pull request #463 from fangyincheng/modify-readme
487c8b7 is described below

commit 487c8b789f24aaa6c033aac1e0b3b830900ad8ad
Author: fangyincheng 
AuthorDate: Thu Apr 2 23:20:02 2020 +0800

Mod: README.md
---
 README.md| 2 ++
 README_CN.md | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 75f5406..5c4de05 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,8 @@ Apache License, Version 2.0
 
 ## Release note ##
 
+[v1.4.0-rc1 - Mar 12, 
2020](https://github.com/apache/dubbo-go/releases/tag/v1.4.0-rc1)
+
 [v1.3.0 - Mar 1, 2020](https://github.com/apache/dubbo-go/releases/tag/v1.3.0)
 
 [v1.2.0 - Nov 15, 2019](https://github.com/apache/dubbo-go/releases/tag/v1.2.0)
diff --git a/README_CN.md b/README_CN.md
index bcb3883..5dec68f 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -15,6 +15,8 @@ Apache License, Version 2.0
 
 ## 发布日志 ##
 
+[v1.4.0-rc1 - 
2020年3月12日](https://github.com/apache/dubbo-go/releases/tag/v1.4.0-rc1)
+
 [v1.3.0 - 2020年3月1日](https://github.com/apache/dubbo-go/releases/tag/v1.3.0)
 
 [v1.2.0 - 2019年11月15日](https://github.com/apache/dubbo-go/releases/tag/v1.2.0)



[dubbo-go] branch develop updated (9340e82 -> 805ffd6)

2020-04-02 Thread panty
This is an automated email from the ASF dual-hosted git repository.

panty pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from 9340e82  Merge pull request #457 from Isaac-Zhang/develop
 new e151ab2  Fix: bug of subscribe
 new 2bdbce5  Fix: bug of subscribe
 new 805ffd6  Merge pull request #462 from hxmhlt/fix_subscribe_bug

The 1870 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.


Summary of changes:
 registry/etcdv3/registry.go | 4 +---
 registry/kubernetes/registry.go | 5 +
 registry/zookeeper/registry.go  | 5 +
 3 files changed, 3 insertions(+), 11 deletions(-)



[dubbo] branch master updated: polish NetUtils#matchIpRange (#5773)

2020-04-02 Thread liujun
This is an automated email from the ASF dual-hosted git repository.

liujun 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 d6672af  polish NetUtils#matchIpRange (#5773)
d6672af is described below

commit d6672afbee70a9fea98a876a225ccb7ea17e028a
Author: tangcent 
AuthorDate: Thu Apr 2 21:23:04 2020 +0800

polish NetUtils#matchIpRange (#5773)
---
 .../java/org/apache/dubbo/common/utils/NetUtils.java| 17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git 
a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java 
b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
index f16dd06..5477bc6 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
@@ -100,7 +100,7 @@ public class NetUtils {
 return getAvailablePort();
 }
 for (int i = port; i < MAX_PORT; i++) {
-try (ServerSocket ss = new ServerSocket(i)) {
+try (ServerSocket ignored = new ServerSocket(i)) {
 return i;
 } catch (IOException e) {
 // continue
@@ -515,7 +515,7 @@ public class NetUtils {
 }
 
 InetAddress inetAddress = InetAddress.getByName(host);
-boolean isIpv4 = isValidV4Address(inetAddress) ? true : false;
+boolean isIpv4 = isValidV4Address(inetAddress);
 String[] hostAndPort = getPatternHostAndPort(pattern, isIpv4);
 if (hostAndPort[1] != null && 
!hostAndPort[1].equals(String.valueOf(port))) {
 return false;
@@ -531,25 +531,22 @@ public class NetUtils {
 checkHostPattern(pattern, mask, isIpv4);
 
 host = inetAddress.getHostAddress();
-
-String[] ipAddress = host.split(splitCharacter);
 if (pattern.equals(host)) {
 return true;
 }
+
 // short name condition
 if (!ipPatternContainExpression(pattern)) {
 InetAddress patternAddress = InetAddress.getByName(pattern);
-if (patternAddress.getHostAddress().equals(host)) {
-return true;
-} else {
-return false;
+return patternAddress.getHostAddress().equals(host);
 }
-}
+
+String[] ipAddress = host.split(splitCharacter);
 for (int i = 0; i < mask.length; i++) {
 if ("*".equals(mask[i]) || mask[i].equals(ipAddress[i])) {
 continue;
 } else if (mask[i].contains("-")) {
-String[] rangeNumStrs = mask[i].split("-");
+String[] rangeNumStrs = StringUtils.split(mask[i], '-');
 if (rangeNumStrs.length != 2) {
 throw new IllegalArgumentException("There is wrong format 
of ip Address: " + mask[i]);
 }



[dubbo] branch master updated (8e07686 -> 93d412b)

2020-04-02 Thread liujun
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


from 8e07686  remove reference destroy guardian (#5863)
 add 93d412b  unit tests for RpcUtils (#5844)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/dubbo/rpc/support/DemoService.java  |   2 +
 .../apache/dubbo/rpc/support/DemoServiceImpl.java  |   5 +
 .../org/apache/dubbo/rpc/support/RpcUtilsTest.java | 149 +
 3 files changed, 156 insertions(+)



[dubbo] branch 2.6.x updated: fix override when interfaces is not null(#5860)

2020-04-02 Thread liujun
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/2.6.x by this push:
 new 280d54c  fix override when interfaces is not null(#5860)
280d54c is described below

commit 280d54c07df26a6e8ba2f6cf2b805d6d3c103d8f
Author: August <33082727+august...@users.noreply.github.com>
AuthorDate: Thu Apr 2 21:15:23 2020 +0800

fix override when interfaces is not null(#5860)
---
 .../src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyFactory.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyFactory.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyFactory.java
index d27f608..20e2e40 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyFactory.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyFactory.java
@@ -45,7 +45,7 @@ public abstract class AbstractProxyFactory implements 
ProxyFactory {
 interfaces[0] = invoker.getInterface();
 interfaces[1] = EchoService.class;
 for (int i = 0; i < types.length; i++) {
-interfaces[i + 1] = ReflectUtils.forName(types[i]);
+interfaces[i + 2] = ReflectUtils.forName(types[i]);
 }
 }
 }



[dubbo] branch master updated (b60acc5 -> 8e07686)

2020-04-02 Thread liujun
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


from b60acc5  fix unit test for qos module (#5962)
 add 8e07686  remove reference destroy guardian (#5863)

No new revisions were added by this update.

Summary of changes:
 .../org/apache/dubbo/config/ReferenceConfig.java | 20 
 1 file changed, 20 deletions(-)



[dubbo-go] branch feature/dubbo-2.7.5 updated (adae0d7 -> e3a4992)

2020-04-02 Thread flycash
This is an automated email from the ASF dual-hosted git repository.

flycash pushed a change to branch feature/dubbo-2.7.5
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git.


from adae0d7  Add publish config method into DynamicConfiguration
 new 0f17847  service name mapping support
 new 21512be  Fix Review
 new 1167e74  Fix review
 new 1aaeb4c  Fix Review
 new 54d0509  Fix Review
 new e3a4992  Merge pull request #453 from flycash/service-name

The 1843 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.


Summary of changes:
 common/constant/key.go |  3 +
 config_center/apollo/impl.go   |  6 ++
 config_center/dynamic_configuration.go | 19 +++--
 config_center/mock_dynamic_config.go   |  7 ++
 config_center/nacos/impl.go|  8 +++
 config_center/zookeeper/impl.go| 23 +-
 config_center/zookeeper/impl_test.go   | 11 ++-
 .../namemapping/dynamic/service_name_mapping.go| 82 ++
 .../dynamic/service_name_mapping_test.go   | 44 
 .../namemapping/memory/service_name_mapping.go | 22 +++---
 .../{report_factory.go => service_name_mapping.go} | 14 ++--
 11 files changed, 197 insertions(+), 42 deletions(-)
 create mode 100644 metadata/namemapping/dynamic/service_name_mapping.go
 copy filter/filter_impl/auth/accesskey_storage_test.go => 
metadata/namemapping/dynamic/service_name_mapping_test.go (50%)
 copy config/mock_rpcservice.go => 
metadata/namemapping/memory/service_name_mapping.go (63%)
 copy metadata/{report_factory.go => service_name_mapping.go} (62%)



[dubbo] branch master updated: fix unit test for qos module (#5962)

2020-04-02 Thread hyunkun
This is an automated email from the ASF dual-hosted git repository.

hyunkun 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 b60acc5  fix unit test for qos module (#5962)
b60acc5 is described below

commit b60acc5e52e7f7f34bb2145df530edbc0f897f74
Author: Huang YunKun 
AuthorDate: Thu Apr 2 14:20:57 2020 +0800

fix unit test for qos module (#5962)
---
 .../java/org/apache/dubbo/qos/command/util/CommandHelperTest.java  | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/util/CommandHelperTest.java
 
b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/util/CommandHelperTest.java
index da2f661..812d5c7 100644
--- 
a/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/util/CommandHelperTest.java
+++ 
b/dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/util/CommandHelperTest.java
@@ -22,9 +22,8 @@ import org.apache.dubbo.qos.command.impl.Ls;
 import org.apache.dubbo.qos.command.impl.Offline;
 import org.apache.dubbo.qos.command.impl.Online;
 import org.apache.dubbo.qos.command.impl.Quit;
-
 import org.apache.dubbo.qos.command.impl.Ready;
-
+import org.apache.dubbo.qos.command.impl.Version;
 import org.junit.jupiter.api.Test;
 
 import java.util.List;
@@ -46,7 +45,9 @@ public class CommandHelperTest {
 @Test
 public void testGetAllCommandClass() throws Exception {
 List> classes = CommandHelper.getAllCommandClass();
-assertThat(classes, containsInAnyOrder(GreetingCommand.class, 
Help.class, Ls.class, Offline.class, Online.class, Quit.class, Ready.class));
+assertThat(classes,
+containsInAnyOrder(GreetingCommand.class, Help.class, 
Ls.class, Offline.class, Online.class, Quit.class,
+Ready.class, Version.class));
 }
 
 @Test