You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by cr...@apache.org on 2019/07/05 13:12:29 UTC

[dubbo] branch master updated: defaultPort can not be null, delete unuse code. (#4480)

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

crazyhzm 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 46215d2  defaultPort can not be null, delete unuse code. (#4480)
46215d2 is described below

commit 46215d20b785b8809a7a741203c5398e711675db
Author: TingSky <bf...@163.com>
AuthorDate: Fri Jul 5 21:11:59 2019 +0800

    defaultPort can not be null, delete unuse code. (#4480)
---
 .../src/main/java/org/apache/dubbo/config/ServiceConfig.java            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
index 257d2a1..c0bd1e8 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
@@ -752,7 +752,7 @@ public class ServiceConfig<T> extends AbstractServiceConfig {
             if (portToBind == null || portToBind == 0) {
                 portToBind = defaultPort;
             }
-            if (portToBind == null || portToBind <= 0) {
+            if (portToBind <= 0) {
                 portToBind = getRandomPort(name);
                 if (portToBind == null || portToBind < 0) {
                     portToBind = getAvailablePort(defaultPort);