geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1452425 - /geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleResourceFinder.java
Date Mon, 04 Mar 2013 18:13:53 GMT
Author: gawor
Date: Mon Mar  4 18:13:52 2013
New Revision: 1452425

URL: http://svn.apache.org/r1452425
Log:
XBEAN-242: Make sure to close ZipInputStream

Modified:
    geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleResourceFinder.java

Modified: geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleResourceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleResourceFinder.java?rev=1452425&r1=1452424&r2=1452425&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleResourceFinder.java
(original)
+++ geronimo/xbean/trunk/xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/BundleResourceFinder.java
Mon Mar  4 18:13:52 2013
@@ -165,8 +165,9 @@ public class BundleResourceFinder {
         if (zipEntry == null) {
             return true;
         }
+        ZipInputStream in = null;
         try {
-            ZipInputStream in = new ZipInputStream(zipEntry.openStream());
+            in = new ZipInputStream(zipEntry.openStream());
             ZipEntry entry;
             while ((entry = in.getNextEntry()) != null) {
                 String name = entry.getName();
@@ -178,6 +179,10 @@ public class BundleResourceFinder {
             }
         } catch (IOException e) {
             e.printStackTrace();
+        } finally {
+            if (in != null) {
+                try { in.close(); } catch (Exception e) {}
+            }
         }
         return true;
     }



Mime
View raw message