karlpauls commented on a change in pull request #14: Zip file extract
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/14#discussion_r291051360
 
 

 ##########
 File path: 
src/main/java/org/apache/sling/feature/scanner/impl/ContentPackageScanner.java
 ##########
 @@ -238,13 +242,16 @@ private ArtifactId extractArtifactId(final File tempDir, 
final File bundleFile)
         final File toDir = new File(tempDir, bundleFile.getName());
         toDir.mkdirs();
 
-        try (final ZipInputStream zis = new ZipInputStream(new 
FileInputStream(bundleFile)) ) {
-            boolean done = false;
-            while ( !done ) {
-                final ZipEntry entry = zis.getNextEntry();
-                if ( entry == null ) {
-                    done = true;
-                } else {
+        ZipFile zipFile = null;
 
 Review comment:
   Same as above - try to use the try() blocks and only open the streams if you 
need them (and don't forget to close)

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