You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/09/28 09:46:12 UTC

[dubbo] branch master updated: [master] Fix remove duplicate method (#8925)

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

albumenj 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 9409f5f  [master] Fix remove duplicate method (#8925)
9409f5f is described below

commit 9409f5f1ec92c9be9c7ce4871461487f6fe7a497
Author: Wang Chengming <63...@qq.com>
AuthorDate: Tue Sep 28 17:46:02 2021 +0800

    [master] Fix remove duplicate method (#8925)
    
    * remove duplicate method on DubboBootstrap#destroy()
    
    * remove duplicate method on DubboBootstrap#destroy()
---
 .../org/apache/dubbo/config/bootstrap/DubboBootstrap.java     | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
index b5928c1..e6e0307 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
@@ -1235,9 +1235,7 @@ public class DubboBootstrap {
 
     private void unregisterServiceInstance() {
         if (serviceInstance != null) {
-            getServiceDiscoveries().forEach(serviceDiscovery -> {
-                serviceDiscovery.unregister(serviceInstance);
-            });
+            getServiceDiscoveries().forEach(serviceDiscovery -> serviceDiscovery.unregister(serviceInstance));
         }
     }
 
@@ -1266,8 +1264,6 @@ public class DubboBootstrap {
                         unexportServices();
                         unreferServices();
                     }
-
-                    destroyRegistries();
                     destroyServiceDiscoveries();
                     destroyExecutorRepository();
                     clear();
@@ -1276,7 +1272,6 @@ public class DubboBootstrap {
                     ExtensionLoader<DubboBootstrapStartStopListener> exts = getExtensionLoader(DubboBootstrapStartStopListener.class);
                     exts.getSupportedExtensionInstances().forEach(ext -> ext.onStop(this));
                 }
-
                 DubboShutdownHook.destroyAll();
             } finally {
                 initialized.set(false);
@@ -1294,9 +1289,7 @@ public class DubboBootstrap {
     }
 
     private void destroyServiceDiscoveries() {
-        getServiceDiscoveries().forEach(serviceDiscovery -> {
-            execute(serviceDiscovery::destroy);
-        });
+        getServiceDiscoveries().forEach(serviceDiscovery -> execute(serviceDiscovery::destroy));
         if (logger.isDebugEnabled()) {
             logger.debug(NAME + "'s all ServiceDiscoveries have been destroyed.");
         }