commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1146027 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Date Wed, 13 Jul 2011 13:53:19 GMT
Author: bodewig
Date: Wed Jul 13 13:53:18 2011
New Revision: 1146027

URL: http://svn.apache.org/viewvc?rev=1146027&view=rev
Log:
Make sure Inflator is cleaned up.  COMPRESS-139

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
  (contents, props changed)

Modified: commons/proper/compress/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=1146027&r1=1146026&r2=1146027&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Wed Jul 13 13:53:18 2011
@@ -45,6 +45,9 @@ The <action> type attribute can be add,u
   </properties>
   <body>
     <release version="1.2" date="as in SVN" description="Release 1.2">
+      <action issue="COMPRESS-139" type="fix" date="2011-07-13">
+        ZipFile may leak resources on some JDKs.
+      </action> 
       <action type="update" date="2011-04-18">
         ZipFile now implements finalize which closes the underlying
         file.

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java?rev=1146027&r1=1146026&r2=1146027&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Wed Jul 13 13:53:18 2011
@@ -317,7 +317,13 @@ public class ZipFile {
                 return bis;
             case ZipArchiveEntry.DEFLATED:
                 bis.addDummy();
-                return new InflaterInputStream(bis, new Inflater(true));
+                final Inflater inflater = new Inflater(true);
+                return new InflaterInputStream(bis, inflater) {
+                    public void close() throws IOException {
+                        super.close();
+                        inflater.end();
+                    }
+                };
             default:
                 throw new ZipException("Found unsupported compression method "
                                        + ze.getMethod());

Propchange: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 13 13:53:18 2011
@@ -1 +1 @@
-/ant/core/trunk/src/main/org/apache/tools/zip/ZipFile.java:738844,738853,739300,741089,747002
+/ant/core/trunk/src/main/org/apache/tools/zip/ZipFile.java:738844,738853,739300,741089,747002,1146020



Mime
View raw message