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 c80295d  Fix method naming errors (#7632)
c80295d is described below

commit c80295db7d1008748d52bec2057ab3256c1e2f2f
Author: 灼华 <[email protected]>
AuthorDate: Tue May 11 09:55:37 2021 +0800

    Fix method naming errors (#7632)
    
    * Fix method naming errors
    
    * Fix unit test
    
    * Fix unit test
---
 .../dubbo/registry/client/EventPublishingServiceDiscovery.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/EventPublishingServiceDiscovery.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/EventPublishingServiceDiscovery.java
index ee99000..b872199 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/EventPublishingServiceDiscovery.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/EventPublishingServiceDiscovery.java
@@ -236,7 +236,7 @@ final class EventPublishingServiceDiscovery implements 
ServiceDiscovery {
     @Override
     public void initialize(URL registryURL) {
 
-        assertInitialized(INITIALIZE_ACTION);
+        assertDestroyed(INITIALIZE_ACTION);
 
         if (isInitialized()) {
             if (logger.isWarnEnabled()) {
@@ -302,14 +302,14 @@ final class EventPublishingServiceDiscovery implements 
ServiceDiscovery {
     }
 
     protected void assertDestroyed(String action) throws IllegalStateException 
{
-        if (!isInitialized()) {
-            throw new IllegalStateException("The action[" + action + "] is 
rejected, because the ServiceDiscovery is not initialized yet.");
+        if (isDestroyed()) {
+            throw new IllegalStateException("The action[" + action + "] is 
rejected, because the ServiceDiscovery is destroyed already.");
         }
     }
 
     protected void assertInitialized(String action) throws 
IllegalStateException {
-        if (isDestroyed()) {
-            throw new IllegalStateException("The action[" + action + "] is 
rejected, because the ServiceDiscovery is destroyed already.");
+        if (!isInitialized()) {
+            throw new IllegalStateException("The action[" + action + "] is 
rejected, because the ServiceDiscovery is not initialized yet.");
         }
     }
 }

Reply via email to