3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-09-16 04:51:22 +02:00

Fixed equals() without hashCode().

Dieser Commit ist enthalten in:
sk89q 2014-04-04 14:40:51 -07:00
Ursprung 478ce3f627
Commit b9c1dc6231
2 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -58,4 +58,17 @@ public class BlockWorldVector2D extends WorldVector2D {
&& (int) other.getZ() == (int) this.z;
}
@Override
public int hashCode() {
int result = super.hashCode();
long temp;
result = 31 * result + world.hashCode();
temp = Double.doubleToLongBits(x);
result = 31 * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(z);
result = 31 * result + (int) (temp ^ (temp >>> 32));
return result;
}
}

Datei anzeigen

@ -212,4 +212,9 @@ public class Snapshot implements Comparable<Snapshot> {
}
return false;
}
@Override
public int hashCode() {
return file.hashCode();
}
}