Browse Source

Don't whine about unclosed archives if the file isn't even there.

Port of https://issues.apache.org/jira/browse/COMPRESS-297
master
Stefan Bodewig 10 years ago
parent
commit
4cbbf3629a
2 changed files with 6 additions and 2 deletions
  1. +4
    -0
      WHATSNEW
  2. +2
    -2
      src/main/org/apache/tools/zip/ZipFile.java

+ 4
- 0
WHATSNEW View File

@@ -60,6 +60,10 @@ Fixed bugs:
when applied to big outputs.
Bugzilla Report 57341

* removed spurious warning about inclosed ZipFiles when reading the
archive failed.
Port of https://issues.apache.org/jira/browse/COMPRESS-297

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



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

@@ -130,7 +130,7 @@ public class ZipFile {
/**
* Whether the file is closed.
*/
private boolean closed;
private volatile boolean closed;

// cached buffers
private final byte[] DWORD_BUF = new byte[DWORD];
@@ -216,9 +216,9 @@ public class ZipFile {
resolveLocalFileHeaderData(entriesWithoutUTF8Flag);
success = true;
} finally {
closed = !success;
if (!success) {
try {
closed = true;
archive.close();
} catch (final IOException e2) {
// swallow, throw the original exception instead


Loading…
Cancel
Save