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/10/04 18:05:05 UTC

[GitHub] [knox] risdenk commented on a change in pull request #162: KNOX-2023 - Recording KnoxShellTable builder/filter chain and providing rollback/replay capabilities using the call history as well as allowing end-users to export JSON without data (in this case only the call history will be serialized)

risdenk commented on a change in pull request #162: KNOX-2023 - Recording KnoxShellTable builder/filter chain and providing rollback/replay capabilities using the call history as well as allowing end-users to export JSON without data (in this case only the call history will be serialized)
URL: https://github.com/apache/knox/pull/162#discussion_r331620385
 
 

 ##########
 File path: gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/CSVKnoxShellTableBuilder.java
 ##########
 @@ -28,24 +28,26 @@
 
   private boolean withHeaders;
 
+  CSVKnoxShellTableBuilder(long id) {
+    super(id);
+  }
+
   public CSVKnoxShellTableBuilder withHeaders() {
     withHeaders = true;
     return this;
   }
 
   public KnoxShellTable url(String url) throws IOException {
     int rowIndex = 0;
-    URLConnection connection;
-    BufferedReader csvReader = null;
     KnoxShellTable table = null;
-    try {
-      URL urlToCsv = new URL(url);
-      connection = urlToCsv.openConnection();
-      csvReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));
+    URL urlToCsv = new URL(url);
+    URLConnection connection = urlToCsv.openConnection();
+    try (BufferedReader csvReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));) {
 
 Review comment:
   Note: this wasn't introduced here but saw the added try-with-resources which is good :)

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