commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1361539 - /commons/proper/net/trunk/src/main/java/examples/Main.java
Date Sat, 14 Jul 2012 13:10:22 GMT
Author: sebb
Date: Sat Jul 14 13:10:22 2012
New Revision: 1361539

URL: http://svn.apache.org/viewvc?rev=1361539&view=rev
Log:
File must be closed after use!

Modified:
    commons/proper/net/trunk/src/main/java/examples/Main.java

Modified: commons/proper/net/trunk/src/main/java/examples/Main.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/Main.java?rev=1361539&r1=1361538&r2=1361539&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/Main.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/Main.java Sat Jul 14 13:10:22 2012
@@ -53,7 +53,6 @@ public class Main {
                 }
                 JarFile jf = new JarFile(sourceFile);
                 Enumeration<JarEntry> e = jf.entries();
-                jf.close();
                 while (e.hasMoreElements()) {
                   JarEntry je = e.nextElement();
                   String name = je.getName();
@@ -72,6 +71,7 @@ public class Main {
                   }
                   map.put(alias, name);
                 }
+                jf.close();
             }
         }
 



Mime
View raw message