Repository: ant Updated Branches: refs/heads/master 2ebe9fc7d -> 4cbbf3629
Don't whine about unclosed archives if the file isn't even there. Port of https://issues.apache.org/jira/browse/COMPRESS-297 Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/4cbbf362 Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/4cbbf362 Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/4cbbf362 Branch: refs/heads/master Commit: 4cbbf3629a15a78615a3ce63ffe6f3fc028b172d Parents: 2ebe9fc Author: Stefan Bodewig <[email protected]> Authored: Tue Jan 20 17:54:31 2015 +0100 Committer: Stefan Bodewig <[email protected]> Committed: Tue Jan 20 17:54:31 2015 +0100 ---------------------------------------------------------------------- WHATSNEW | 4 ++++ src/main/org/apache/tools/zip/ZipFile.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/4cbbf362/WHATSNEW ---------------------------------------------------------------------- diff --git a/WHATSNEW b/WHATSNEW index ea3f75a..f188f26 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -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: -------------- http://git-wip-us.apache.org/repos/asf/ant/blob/4cbbf362/src/main/org/apache/tools/zip/ZipFile.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/zip/ZipFile.java b/src/main/org/apache/tools/zip/ZipFile.java index 0771c1f..7a2c992 100644 --- a/src/main/org/apache/tools/zip/ZipFile.java +++ b/src/main/org/apache/tools/zip/ZipFile.java @@ -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
