You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/18 14:40:43 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #4303: [pulsar-io] Remove unused annotation

merlimat commented on a change in pull request #4303: [pulsar-io] Remove unused annotation
URL: https://github.com/apache/pulsar/pull/4303#discussion_r285344732
 
 

 ##########
 File path: pulsar-io/file/src/main/java/org/apache/pulsar/io/file/utils/ZipFiles.java
 ##########
 @@ -44,19 +43,16 @@
     /**
      * Returns true if the given file is a gzip file.
      */
-   @SuppressWarnings("deprecation")
-   public static boolean isZip(File f) {
-
-       InputStream input = null;
+    public static boolean isZip(File f) {
+        DataInputStream in = null;
         try {
-            DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(f)));
+            in = new DataInputStream(new BufferedInputStream(new FileInputStream(f)));
 
 Review comment:
   This could be further improved with : 
   
   ```java
   try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(f))) {
        /// ... 
   }
   ```

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