Skip to content

Commit 87a40d8

Browse files
committed
chage the type for the .equals
1 parent 799670d commit 87a40d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/eu/mihosoft/vrl/v3d/Vector3d.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,18 @@ public String toString() {
430430
*/
431431
@Override
432432
public boolean equals(Object obj) {
433-
return test(obj,Plane.EPSILON_Point);
433+
if (!Vector3d.class.isInstance(obj)) {
434+
return false;
435+
}
436+
return test((Vector3d)obj,Plane.EPSILON_Point);
434437
}
435438

436439
double distance(Vector3d v) {
437440
Vector3d diff = v.minus(this);
438441
return diff.magnitude();
439442
}
440443

441-
public boolean test(Object obj, double epsilon) {
444+
public boolean test(Vector3d obj, double epsilon) {
442445
if (obj == null) {
443446
return false;
444447
}

0 commit comments

Comments
 (0)