[ 
https://issues.apache.org/jira/browse/KNOX-2189?focusedWorklogId=384957&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-384957
 ]

ASF GitHub Bot logged work on KNOX-2189:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Feb/20 03:15
            Start Date: 11/Feb/20 03:15
    Worklog Time Spent: 10m 
      Work Description: risdenk commented on 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 384957)
    Time Spent: 1h 40m  (was: 1.5h)

> KnoxShellTable.select() must handle whitespace
> ----------------------------------------------
>
>                 Key: KNOX-2189
>                 URL: https://issues.apache.org/jira/browse/KNOX-2189
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: KnoxShell
>            Reporter: Larry McCay
>            Assignee: Ljmiv
>            Priority: Minor
>              Labels: noob
>             Fix For: 1.4.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> KnoxShellTable.select() takes a comma separated list of col names. However, 
> it currently doesn't support whitespace within the list.
> Rather than splitting on "," we need to include whitespace matching in the 
> regex.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to