You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/02/07 01:01:38 UTC

[GitHub] [knox] risdenk commented on a change in pull request #256: KNOX-2189 - KnoxShellTable.select() must handle whitespace

risdenk commented on a change in pull request #256: KNOX-2189 - KnoxShellTable.select() must handle whitespace
URL: https://github.com/apache/knox/pull/256#discussion_r376166168
 
 

 ##########
 File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTable.java
 ##########
 @@ -356,7 +356,7 @@ public KnoxShellTableFilter filter() {
   public KnoxShellTable select(String cols) {
     KnoxShellTable table = new KnoxShellTable();
     List<List<Comparable<? extends Object>>> columns = new ArrayList<>();
-    String[] colnames = cols.split(",");
+    String[] colnames = cols.split(",\\s*");
 
 Review comment:
   Does this work if `Column A` or `Column C` has trailing whitespace? It might be better to split on comma and then do a `colName.trim()` or something along those lines.

----------------------------------------------------------------
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


With regards,
Apache Git Services