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 2019/09/30 13:18:09 UTC

[GitHub] [knox] risdenk commented on a change in pull request #160: KNOX-2024 - KnoxShellTable - Case Insensitive Operations with Col Names

risdenk commented on a change in pull request #160: KNOX-2024 - KnoxShellTable - Case Insensitive Operations with Col Names
URL: https://github.com/apache/knox/pull/160#discussion_r329570173
 
 

 ##########
 File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTableFilter.java
 ##########
 @@ -32,7 +32,15 @@ public KnoxShellTableFilter table(KnoxShellTable table) {
   }
 
   public KnoxShellTableFilter name(String name) {
-    index = tableToFilter == null ? -1 : tableToFilter.headers.indexOf(name);
+    for (int i = 0; i < tableToFilter.headers.size(); i++) {
+      if (tableToFilter.headers.get(i).equalsIgnoreCase(name)) {
+        index = i;
 
 Review comment:
   What is index used for outside of this method? Could there be an issue that index is being updated and changed to -1 on no matches before switched back to the right index?

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