commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1649052 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
Date Fri, 02 Jan 2015 14:48:13 GMT
Author: bodewig
Date: Fri Jan  2 14:48:13 2015
New Revision: 1649052

URL: http://svn.apache.org/r1649052
Log:
ZipArchiveEntry's copy-constructor was incomplete

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java?rev=1649052&r1=1649051&r2=1649052&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
Fri Jan  2 14:48:13 2015
@@ -138,6 +138,9 @@ public class ZipArchiveEntry extends jav
         setInternalAttributes(entry.getInternalAttributes());
         setExternalAttributes(entry.getExternalAttributes());
         setExtraFields(entry.getExtraFields(true));
+        setPlatform(entry.platform);
+        setGeneralPurposeBit(entry.gpb == null ? null : 
+                             (GeneralPurposeBit) entry.gpb.clone());
     }
 
     /**

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java?rev=1649052&r1=1649051&r2=1649052&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
Fri Jan  2 14:48:13 2015
@@ -253,4 +253,13 @@ public class ZipArchiveEntryTest extends
         assertFalse(entry1.equals(entry3));
         assertFalse(entry2.equals(entry3));
     }
+
+    public void testCopyConstructor() throws Exception {
+        ZipArchiveEntry archiveEntry = new ZipArchiveEntry("fred");
+        archiveEntry.setUnixMode(0664);
+        archiveEntry.setMethod(ZipEntry.DEFLATED);
+        archiveEntry.getGeneralPurposeBit().useStrongEncryption(true);
+        ZipArchiveEntry copy = new ZipArchiveEntry(archiveEntry);
+        assertEquals(archiveEntry, copy);
+    }
 }



Mime
View raw message