You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2018/09/07 07:47:24 UTC

commons-compress git commit: correctly set hasCo..LevelChanged with repeated setLevel calls

Repository: commons-compress
Updated Branches:
  refs/heads/master 5fd497fa3 -> f7726c4f7


correctly set hasCo..LevelChanged with repeated setLevel calls

see Ant bug https://bz.apache.org/bugzilla/show_bug.cgi?id=62686


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/f7726c4f
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/f7726c4f
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/f7726c4f

Branch: refs/heads/master
Commit: f7726c4f727dd78f616374f87ae1e9424b41af67
Parents: 5fd497f
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Sep 7 09:46:05 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Sep 7 09:46:05 2018 +0200

----------------------------------------------------------------------
 .../commons/compress/archivers/zip/ZipArchiveOutputStream.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/f7726c4f/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
index 584bb46..76aa0e1 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
@@ -875,7 +875,10 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream {
             throw new IllegalArgumentException("Invalid compression level: "
                                                + level);
         }
-        hasCompressionLevelChanged = (this.level != level);
+        if (this.level == level) {
+            return;
+        }
+        hasCompressionLevelChanged = true;
         this.level = level;
     }