Skip to content

Commit

Permalink
Fix Java11 for equals
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRisenPhoenix committed Mar 6, 2024
1 parent 7c3fefb commit 5d61bc7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/util/Matrix3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ public Matrix3D invert() {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Matrix3D matrix3D)) return false;
if (!(o instanceof Matrix3D)) return false;

Matrix3D matrix3D = (Matrix3D) o;

return Arrays.deepEquals(matrix, matrix3D.matrix);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/util/Quaternion.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ public String toString() {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Quaternion that)) return false;
if (!(o instanceof Quaternion)) return false;

Quaternion that = (Quaternion) o;

if (Double.compare(w, that.w) != 0) return false;
if (Double.compare(x, that.x) != 0) return false;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/util/Vector3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ public String toString() {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Vector3D vector3D)) return false;
if (!(o instanceof Vector3D)) return false;

Vector3D vector3D = (Vector3D) o;

return Arrays.equals(vector, vector3D.vector);
}
Expand Down

0 comments on commit 5d61bc7

Please sign in to comment.