This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 e0dfc9b Minor tweaks to code style (#15453)
e0dfc9b is described below
commit e0dfc9bcb3b0b772dc5fe32db04def8546512cf6
Author: Guocheng Tang <[email protected]>
AuthorDate: Wed Feb 16 23:10:23 2022 +0800
Minor tweaks to code style (#15453)
---
.../main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java | 3 ++-
.../shadow/distsql/handler/checker/ShadowRuleStatementChecker.java | 3 +++
.../shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
index 1de3a9a..a2ed347 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
@@ -36,6 +36,7 @@ import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Objects;
import java.util.Optional;
@@ -216,7 +217,7 @@ public final class ShadowRule implements SchemaRule,
DataSourceContainedRule {
*/
public Map<String, String> getAllShadowDataSourceMappings() {
Map<String, String> result = new LinkedHashMap<>();
- for (Map.Entry<String, ShadowDataSourceRule> entry :
shadowDataSourceMappings.entrySet()) {
+ for (Entry<String, ShadowDataSourceRule> entry :
shadowDataSourceMappings.entrySet()) {
ShadowDataSourceRule rule = entry.getValue();
result.put(rule.getSourceDataSource(), rule.getShadowDataSource());
}
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/checker/ShadowRuleStatementChecker.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/checker/ShadowRuleStatementChecker.java
index 5153ca2..61add44 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/checker/ShadowRuleStatementChecker.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/checker/ShadowRuleStatementChecker.java
@@ -75,6 +75,7 @@ public class ShadowRuleStatementChecker {
/**
* Check if the rules exist.
+ *
* @param requireRules require rules
* @param currentRules current rules
* @param thrower thrower
@@ -87,6 +88,7 @@ public class ShadowRuleStatementChecker {
/**
* Check if the algorithms exist.
+ *
* @param requireAlgorithms require algorithms
* @param currentAlgorithms current algorithms
* @param thrower thrower
@@ -99,6 +101,7 @@ public class ShadowRuleStatementChecker {
/**
* Check for any duplicate data in the rules, and throw the specified
exception.
+ *
* @param rules rules to be checked
* @param thrower exception thrower
* @throws DistSQLException DistSQL exception
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
index ab4b68e..ef2a710 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java
@@ -127,7 +127,7 @@ public final class ShadowDistSQLStatementVisitor extends
ShadowDistSQLStatementB
@Override
public ASTNode visitDropShadowAlgorithm(final DropShadowAlgorithmContext
ctx) {
return new DropShadowAlgorithmStatement(null == ctx.algorithmName() ?
Collections.emptyList()
- : ctx.algorithmName().stream().map(each ->
getIdentifierValue(each)).collect(Collectors.toSet()));
+ :
ctx.algorithmName().stream().map(this::getIdentifierValue).collect(Collectors.toSet()));
}
@Override