From 853a43b95103c5653b992d1594db294ecf665f5d Mon Sep 17 00:00:00 2001 From: Jacobus Martinus Kruithof Date: Tue, 11 Jan 2005 23:09:36 +0000 Subject: [PATCH] PR: 33049 A zip entry is not equal to another zip entry when the name matches. Multiple files may have the same name, and have for instance different offsets. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277346 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/zip/ZipEntry.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/org/apache/tools/zip/ZipEntry.java b/src/main/org/apache/tools/zip/ZipEntry.java index a812d05b5..6847419a5 100644 --- a/src/main/org/apache/tools/zip/ZipEntry.java +++ b/src/main/org/apache/tools/zip/ZipEntry.java @@ -400,30 +400,32 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable { this.name = name; } - /** + /* Two zipentries are not necessarily equal if they have the same name. */ + /* * Get the hashCode of the entry. * This uses the name as the hashcode. * @return a hashcode. * @since Ant 1.7 */ - public int hashCode() { +/* public int hashCode() { return getName().hashCode(); } - - /** +*/ + /* * The equality method. + * @param o the object to compare to * @return true if this object has the same name as o * @since Ant 1.7 */ - public boolean equals(Object o) { +/* public boolean equals(Object o) { if (o instanceof ZipEntry) { ZipEntry other = (ZipEntry) o; return other.getName().equals(getName()); } return false; } - +*/ /** * Helper for JDK 1.1 *