Browse Source

clean up Inflater instance as some JDKs won't do it for us. PR 42696. Submitted by Mounir

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1146020 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
c4c9d2552b
4 changed files with 15 additions and 1 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +4
    -0
      WHATSNEW
  3. +3
    -0
      contributors.xml
  4. +7
    -1
      src/main/org/apache/tools/zip/ZipFile.java

+ 1
- 0
CONTRIBUTORS View File

@@ -238,6 +238,7 @@ Miha
Mike Davis
Mike Roberts
mnowostawski
Mounir
Nathan Beyer
Nick Chalko
Nick Fortescue


+ 4
- 0
WHATSNEW View File

@@ -55,6 +55,10 @@ Fixed bugs:
error output stream some "Pipe broken" errors.
Bugzilla Report 48789.

* ZipFile failed to clean up some resources which could lead to
OutOfMemoryException while unzipping large archives.
Bugzilla Report 42969.

Other changes:
--------------



+ 3
- 0
contributors.xml View File

@@ -976,6 +976,9 @@
<name>
<last>mnowostawski</last>
</name>
<name>
<last>Mounir</last>
</name>
<name>
<first>Nathan</first>
<last>Beyer</last>


+ 7
- 1
src/main/org/apache/tools/zip/ZipFile.java View File

@@ -269,7 +269,13 @@ public class ZipFile {
return bis;
case ZipEntry.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());


Loading…
Cancel
Save