Making TarEntry.equals a standard java equals method (with .hashCode method)

This commit is contained in:
Felix Dörre 2014-06-24 23:53:54 +02:00
parent e768f32bd1
commit 46a20204bc

View File

@ -58,8 +58,18 @@ public class TarEntry {
this.header = header;
}
public boolean equals(TarEntry it) {
return header.name.toString().equals(it.header.name.toString());
@Override
public boolean equals(Object it) {
if (!(it instanceof TarEntry)) {
return false;
}
return header.name.toString().equals(
((TarEntry) it).header.name.toString());
}
@Override
public int hashCode() {
return header.name.hashCode();
}
public boolean isDescendent(TarEntry desc) {