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

 ##########
 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:
   Done; please squash the 2 commits into the first one and keep the original 
commit message when merging. Thanks! 

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