Repository: ant Updated Branches: refs/heads/master d7c518584 -> fde6b0e94
bz-62686 Correctly handle compression level changes in ZipOutputStream Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/c07bd866 Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/c07bd866 Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/c07bd866 Branch: refs/heads/master Commit: c07bd866840a1757f03ed57c5e376b9c5af4ed52 Parents: 6377dfc Author: Jaikiran Pai <[email protected]> Authored: Fri Sep 7 10:44:44 2018 +0530 Committer: Jaikiran Pai <[email protected]> Committed: Fri Sep 7 10:47:24 2018 +0530 ---------------------------------------------------------------------- WHATSNEW | 4 ++++ src/main/org/apache/tools/zip/ZipOutputStream.java | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/c07bd866/WHATSNEW ---------------------------------------------------------------------- diff --git a/WHATSNEW b/WHATSNEW index f67c79a..9d96ca5 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -12,6 +12,10 @@ Fixed bugs: instead of a IllegalStateException in the absence of the "id" attribute. Bugzilla Report 62655 + * org.apache.tools.zip.ZipOutputStream would sometimes potentially use + an incorrect compression level for a zip entry. This is now fixed. + Bugzilla Report 62686 + Other changes: -------------- * generatekey task now supports SubjectAlternativeName during key http://git-wip-us.apache.org/repos/asf/ant/blob/c07bd866/src/main/org/apache/tools/zip/ZipOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/zip/ZipOutputStream.java b/src/main/org/apache/tools/zip/ZipOutputStream.java index f2117d8..ef850ee 100644 --- a/src/main/org/apache/tools/zip/ZipOutputStream.java +++ b/src/main/org/apache/tools/zip/ZipOutputStream.java @@ -867,7 +867,10 @@ public class ZipOutputStream extends FilterOutputStream { throw new IllegalArgumentException("Invalid compression level: " + level); } - hasCompressionLevelChanged = (this.level != level); + if (this.level == level) { + return; + } + hasCompressionLevelChanged = true; this.level = level; }
