You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by xi...@apache.org on 2020/11/21 04:04:24 UTC

[shardingsphere] branch master updated: Refactor ShowTablesBackendHandler's return value to collection (#8260)

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

xiaoyu 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 7954f6c  Refactor ShowTablesBackendHandler's return value to collection (#8260)
7954f6c is described below

commit 7954f6c404fa4679c2a655ce55051c1059794b6f
Author: Liang Zhang <te...@163.com>
AuthorDate: Sat Nov 21 12:04:09 2020 +0800

    Refactor ShowTablesBackendHandler's return value to collection (#8260)
    
    * For code style
    
    * Refactor ShowTablesBackendHandler's return value to collection
---
 .../shardingsphere/infra/executor/sql/context/ExecutionContext.java   | 2 +-
 .../proxy/backend/text/admin/ShowTablesBackendHandler.java            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java
index bf286a8..b855745 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/context/ExecutionContext.java
@@ -37,7 +37,7 @@ public final class ExecutionContext {
     private final Collection<ExecutionUnit> executionUnits;
     
     private final RouteContext routeContext;
-
+    
     public ExecutionContext(final SQLStatementContext<?> sqlStatementContext, final ExecutionUnit executionUnit, final RouteContext routeContext) {
         this(sqlStatementContext, Collections.singletonList(executionUnit), routeContext);
     }
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java
index 5fff1c8..99db2d0 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java
@@ -32,9 +32,9 @@ import org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandler;
 
 import java.sql.SQLException;
 import java.sql.Types;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -76,7 +76,7 @@ public final class ShowTablesBackendHandler implements TextProtocolBackendHandle
     
     @Override
     public Collection<Object> getRowData() throws SQLException {
-        List<Object> result = new ArrayList<>(queryResponse.getQueryHeaders().size());
+        Collection<Object> result = new LinkedList<>();
         for (int columnIndex = 1; columnIndex <= queryResponse.getQueryHeaders().size(); columnIndex++) {
             result.add(queryResponse.getQueryResults().get(0).getValue(columnIndex, Object.class));
         }