commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject commons-compress git commit: COMPRESS-429 set namesource to extra field even if names match
Date Sun, 07 Jan 2018 09:22:56 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/COMPRESS-429 eb32d62fa -> c2906092f


COMPRESS-429 set namesource to extra field even if names match


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

Branch: refs/heads/COMPRESS-429
Commit: c2906092f9fab7bb718ba177d521ae152d4d9f1c
Parents: eb32d62
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Jan 7 10:22:25 2018 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Jan 7 10:22:25 2018 +0100

----------------------------------------------------------------------
 .../org/apache/commons/compress/archivers/zip/ZipUtil.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/c2906092/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
index 6342cd1..783835c 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
@@ -237,8 +237,10 @@ public abstract class ZipUtil {
         final String originalName = ze.getName();
         final String newName = getUnicodeStringIfOriginalMatches(name,
                                                            originalNameBytes);
-        if (newName != null && !originalName.equals(newName)) {
-            ze.setName(newName);
+        if (newName != null) {
+            if (!originalName.equals(newName)) {
+                ze.setName(newName);
+            }
             ze.setNameSource(ZipArchiveEntry.NameSource.UNICODE_EXTRA_FIELD);
         }
 


Mime
View raw message