Fixed tests and fixed failed tests

This commit is contained in:
2022-08-22 22:24:36 +02:00
parent 01456bfc9f
commit 8825f4b3cc
2 changed files with 12 additions and 8 deletions
+8 -4
View File
@@ -25,13 +25,13 @@ public class Lock implements Comparable {
@Override
public final boolean equals(@Nullable Object o) {
if (this == o) {
Lock other = (Lock) o;
if (this == other) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (other == null || getClass() != other.getClass()) {
return false;
}
Lock other = (Lock) o;
return data.equals(other.data) && serverHash == other.serverHash;
}
@@ -43,6 +43,10 @@ public class Lock implements Comparable {
@Override
public int compareTo(@NotNull Object o) {
return ((Lock) o).data.compareTo(data);
Lock lock = (Lock) o;
int data = lock.data.compareTo(this.data);
if (data != 0)
return data;
return Integer.compare(lock.getServerHash(), getServerHash());
}
}