Merge pull request #15 from yellowant/master

Making TarEntry.equals a standard java equals method (with .hashCode method)
This commit is contained in:
Kamran 2016-11-16 12:12:43 +00:00 committed by GitHub
commit 8f25838636

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) {