Simplifying equals method and changing class check to use instanceof.

This commit is contained in:
anthonyflynn 2018-02-04 19:55:02 +00:00
parent 1834bc4812
commit 23bfd4bf7d

View File

@ -16,13 +16,9 @@ public class Package {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (!(o instanceof Package)) return false;
Package that = (Package) o; Package that = (Package) o;
return name.equals(that.name);
if (!name.equals(that.name)) return false;
return true;
} }
@Override @Override