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

zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 53e3daebcf0 Fix sonar issue (#27469)
53e3daebcf0 is described below

commit 53e3daebcf072302a759165b3da5da37a69c963c
Author: ChenJiaHao <[email protected]>
AuthorDate: Wed Jul 26 13:29:20 2023 +0800

    Fix sonar issue (#27469)
---
 .../handler/distsql/rdl/rule/NewRuleDefinitionBackendHandler.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/NewRuleDefinitionBackendHandler.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/NewRuleDefinitionBackendHandler.java
index 919d0943b8f..09909a369c4 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/NewRuleDefinitionBackendHandler.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rdl/rule/NewRuleDefinitionBackendHandler.java
@@ -142,7 +142,6 @@ public final class NewRuleDefinitionBackendHandler<T 
extends RuleDefinitionState
         }
         ModeContextManager modeContextManager = 
ProxyContext.getInstance().getContextManager().getInstanceContext().getModeContextManager();
         final RuleConfiguration toBeDroppedRuleConfig = 
updater.buildToBeDroppedRuleConfiguration(currentRuleConfig, sqlStatement);
-        final RuleConfiguration toBeAlteredRuleConfig = 
updater.buildToBeAlteredRuleConfiguration(currentRuleConfig, sqlStatement);
         // TODO remove updateCurrentRuleConfiguration after update refactor 
completed.
         if (updater.updateCurrentRuleConfiguration(sqlStatement, 
currentRuleConfig) && ((DatabaseRuleConfiguration) 
currentRuleConfig).isEmpty()) {
             modeContextManager.removeRuleConfigurationItem(database.getName(), 
toBeDroppedRuleConfig);
@@ -156,6 +155,7 @@ public final class NewRuleDefinitionBackendHandler<T 
extends RuleDefinitionState
             // TODO refactor to new metadata refresh way
         }
         modeContextManager.removeRuleConfigurationItem(database.getName(), 
toBeDroppedRuleConfig);
+        final RuleConfiguration toBeAlteredRuleConfig = 
updater.buildToBeAlteredRuleConfiguration(currentRuleConfig, sqlStatement);
         return modeContextManager.alterRuleConfiguration(database.getName(), 
toBeAlteredRuleConfig);
     }
     

Reply via email to