You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:31:33 UTC

[GitHub] [shardingsphere] tristaZero commented on a change in pull request #10676: 10374 - code refactoring for process report feature

tristaZero commented on a change in pull request #10676:
URL: https://github.com/apache/shardingsphere/pull/10676#discussion_r649724326



##########
File path: shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
##########
@@ -62,10 +63,8 @@
             // TODO Load query header for first query
             List<ExecuteResult> results = execute(executionGroupContext, (RawSQLExecutorCallback) null, callback);
             ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
-            if (null == results || results.isEmpty() || null == results.get(0)) {
-                return Collections.singleton(new UpdateResult(0, 0L));
-            }
-            return results;
+            return CollectionUtils.isEmpty(results) || Objects.isNull(results.get(0)) ? Collections
+                .singleton(new UpdateResult(0, 0L)) : results;

Review comment:
       Hi @SivaTharun ,
   Do you think `return null == results || results.isEmpty() || null == results.get(0) ? Collections.singleton(new UpdateResult(0, 0L)) : results`

##########
File path: shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
##########
@@ -62,10 +63,8 @@
             // TODO Load query header for first query
             List<ExecuteResult> results = execute(executionGroupContext, (RawSQLExecutorCallback) null, callback);
             ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
-            if (null == results || results.isEmpty() || null == results.get(0)) {
-                return Collections.singleton(new UpdateResult(0, 0L));
-            }
-            return results;
+            return CollectionUtils.isEmpty(results) || Objects.isNull(results.get(0)) ? Collections
+                .singleton(new UpdateResult(0, 0L)) : results;

Review comment:
       Hi @SivaTharun Thanks for your clarification which is fine with me.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org