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_r377430831
 
 

 ##########
 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:
   what happens in this case:
   
   `"         Column A         ,            Column B            ,        Column 
C               "`
   
   Right now you are just testing the case where you are looking for. You just 
happen to have the correct regex and trim. Any trailing space after a column 
name before a comma looks like it will fail.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to