diff --git a/common/src/main/java/ctbrec/Recording.java b/common/src/main/java/ctbrec/Recording.java index 6237baaa..9394bda0 100644 --- a/common/src/main/java/ctbrec/Recording.java +++ b/common/src/main/java/ctbrec/Recording.java @@ -222,9 +222,7 @@ public class Recording implements Serializable { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((getStartDate() == null) ? 0 : (int) (getStartDate().toEpochMilli() ^ (getStartDate().toEpochMilli() >>> 32))); - result = prime * result + ((model == null) ? 0 : model.hashCode()); - result = prime * result + ((getAbsoluteFile() == null) ? 0 : getAbsoluteFile().hashCode()); + result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @@ -234,27 +232,14 @@ public class Recording implements Serializable { return true; if (obj == null) return false; - if(!(obj instanceof Recording)) { + if (getClass() != obj.getClass()) return false; - } Recording other = (Recording) obj; - if (getModel() == null) { - if (other.getModel() != null) { + if (id == null) { + if (other.id != null) return false; - } - } else if (!getModel().equals(other.getModel())) { + } else if (!id.equals(other.id)) return false; - } - if (!getAbsoluteFile().equals(other.getAbsoluteFile())) { - return false; - } - if (getStartDate() == null) { - if (other.getStartDate() != null) { - return false; - } - } else if (getStartDate().toEpochMilli() != other.getStartDate().toEpochMilli()) { - return false; - } return true; }