lmccay4 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_r330201592
##########
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:
I see your original concern, my bad. `index` is a member variable of the
filter class and only ever used in that one filter instance, not a global
variable. As for -1, that is the returned index when no matches exist, which
throws an exception.
----------------------------------------------------------------
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