Browse Source

Fix incorrect equals() override

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274924 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
153a8fa06c
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      src/main/org/apache/tools/tar/TarEntry.java

+ 14
- 0
src/main/org/apache/tools/tar/TarEntry.java View File

@@ -325,6 +325,20 @@ public class TarEntry implements TarConstants {
return this.getName().equals(it.getName());
}

/**
* 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.
*


Loading…
Cancel
Save