bodewig 2003/07/24 06:14:31
Modified: src/main/org/apache/tools/tar TarEntry.java
Log:
Fix incorrect equals() override
Revision Changes Path
1.17 +14 -0 ant/src/main/org/apache/tools/tar/TarEntry.java
Index: TarEntry.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/tar/TarEntry.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- TarEntry.java 4 Jul 2003 13:03:38 -0000 1.16
+++ TarEntry.java 24 Jul 2003 13:14:31 -0000 1.17
@@ -326,6 +326,20 @@
}
/**
+ * Determine if the two entries are equal. Equality is determined
+ * by the header names being equal.
+ *
+ * @param it Entry to be checked for equality.
+ * @return True if the entries are equal.
+ */
+ public boolean equals(Object it) {
+ if (it == null || getClass() != it.getClass()) {
+ return false;
+ }
+ return equals((TarEntry) it);
+ }
+
+ /**
* Hashcodes are based on entry names.
*
* @return the entry hashcode
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]