You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/03/25 11:59:32 UTC

[GitHub] [calcite-avatica] joshelser commented on a change in pull request #90: [CALCITE-2950] Avatica DriverVersion.load leaks InputStream

joshelser commented on a change in pull request #90: [CALCITE-2950] Avatica DriverVersion.load leaks InputStream
URL: https://github.com/apache/calcite-avatica/pull/90#discussion_r268606069
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/avatica/DriverVersion.java
 ##########
 @@ -138,6 +139,14 @@ public static DriverVersion load(
       }
     } catch (IOException e) {
       e.printStackTrace();
+    } finally {
+      if (inStream != null) {
+        try {
+          inStream.close();
+        } catch (IOException ignore) {
+          ignore.printStackTrace();
 
 Review comment:
   Could you re-throw the caught IOException as a `RuntimeException`? I can't think of a situation where this should ever fail. I'm not sure if we want this printed to stdout like you have it doing either (get a logger instance if you think this would be important. I think it would be fine to just re-throw this)

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