commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r903086 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
Date Tue, 26 Jan 2010 05:24:17 GMT
Author: bodewig
Date: Tue Jan 26 05:24:17 2010
New Revision: 903086

URL: http://svn.apache.org/viewvc?rev=903086&view=rev
Log:
complete equals implementation.  COMPRESS-94

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.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=903086&r1=903085&r2=903086&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
Tue Jan 26 05:24:17 2010
@@ -18,6 +18,7 @@
 package org.apache.commons.compress.archivers.zip;
 
 import java.io.File;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.zip.ZipException;
@@ -469,6 +470,26 @@
         } else if (!myName.equals(otherName)) {
             return false;
         }
-        return true;
+        String myComment = getComment();
+        String otherComment = other.getComment();
+        if (myComment == null) {
+            if (otherComment != null) {
+                return false;
+            }
+        } else if (!myComment.equals(otherComment)) {
+            return false;
+        }
+        return getTime() == other.getTime()
+            && getInternalAttributes() == other.getInternalAttributes()
+            && getPlatform() == other.getPlatform()
+            && getExternalAttributes() == other.getExternalAttributes()
+            && getMethod() == other.getMethod()
+            && getSize() == other.getSize()
+            && getCrc() == other.getCrc()
+            && getCompressedSize() == other.getCompressedSize()
+            && Arrays.equals(getCentralDirectoryExtra(),
+                             other.getCentralDirectoryExtra())
+            && Arrays.equals(getLocalFileDataExtra(),
+                             other.getLocalFileDataExtra());
     }
 }



Mime
View raw message