You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2023/05/10 15:55:11 UTC

[shardingsphere] branch master updated: Fix sonar issue of KernelDistSQLStatementVisitor (#25561)

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

sunnianjun 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 8568456bd0a Fix sonar issue of KernelDistSQLStatementVisitor (#25561)
8568456bd0a is described below

commit 8568456bd0a771d4f067ebf7df5fbe09e820f1b3
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed May 10 23:55:03 2023 +0800

    Fix sonar issue of KernelDistSQLStatementVisitor (#25561)
---
 .../distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java b/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
index 3077e3e5879..0a54f169523 100644
--- a/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
+++ b/distsql/parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java
@@ -115,6 +115,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.Identifi
 import org.apache.shardingsphere.sql.parser.sql.common.value.literal.impl.StringLiteralValue;
 
 import java.util.Collection;
+import java.util.Objects;
 import java.util.Properties;
 import java.util.stream.Collectors;
 
@@ -263,7 +264,7 @@ public final class KernelDistSQLStatementVisitor extends KernelDistSQLStatementB
     
     @Override
     public ASTNode visitShowDistVariable(final ShowDistVariableContext ctx) {
-        return new ShowDistVariableStatement(getIdentifierValue(ctx.variableName()).toUpperCase());
+        return new ShowDistVariableStatement(Objects.requireNonNull(getIdentifierValue(ctx.variableName())).toUpperCase());
     }
     
     @Override