mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-12 02:13:42 -04:00
Fixed 35 FindBugs errors
This commit is contained in:
@@ -165,15 +165,15 @@ public class Location implements Encodable, Serializable {
|
||||
|
||||
public boolean mergeLocation(double lX, double lY, double lZ) {
|
||||
boolean changed = false;
|
||||
if (Double.isNaN(getX()) || getX() != lX) {
|
||||
if (Double.isNaN(getX()) || !isEqual(getX(), lX)) {
|
||||
setX(lX);
|
||||
changed = true;
|
||||
}
|
||||
if (Double.isNaN(getY()) || getY() != lY) {
|
||||
if (Double.isNaN(getY()) || !isEqual(getY(), lY)) {
|
||||
setY(lY);
|
||||
changed = true;
|
||||
}
|
||||
if (Double.isNaN(getZ()) || getZ() != lZ) {
|
||||
if (Double.isNaN(getZ()) || !isEqual(getZ(), lZ)) {
|
||||
setZ(lZ);
|
||||
changed = true;
|
||||
}
|
||||
@@ -186,19 +186,19 @@ public class Location implements Encodable, Serializable {
|
||||
double oZ = getOrientationZ();
|
||||
double oW = getOrientationW();
|
||||
boolean changed = false;
|
||||
if (!Double.isNaN(l.getOrientationX()) && (Double.isNaN(oX) || oX != l.getOrientationX())) {
|
||||
if (!Double.isNaN(l.getOrientationX()) && (Double.isNaN(oX) || !isEqual(oX, l.getOrientationX()))) {
|
||||
oX = l.getOrientationX();
|
||||
changed = true;
|
||||
}
|
||||
if (!Double.isNaN(l.getOrientationY()) && (Double.isNaN(oY) || oY != l.getOrientationY())) {
|
||||
if (!Double.isNaN(l.getOrientationY()) && (Double.isNaN(oY) || !isEqual(oY, l.getOrientationY()))) {
|
||||
oY = l.getOrientationY();
|
||||
changed = true;
|
||||
}
|
||||
if (!Double.isNaN(l.getOrientationZ()) && (Double.isNaN(oZ) || oZ != l.getOrientationZ())) {
|
||||
if (!Double.isNaN(l.getOrientationZ()) && (Double.isNaN(oZ) || !isEqual(oZ, l.getOrientationZ()))) {
|
||||
oZ = l.getOrientationZ();
|
||||
changed = true;
|
||||
}
|
||||
if (!Double.isNaN(l.getOrientationW()) && (Double.isNaN(oW) || oW != l.getOrientationW())) {
|
||||
if (!Double.isNaN(l.getOrientationW()) && (Double.isNaN(oW) || !isEqual(oW, l.getOrientationW()))) {
|
||||
oW = l.getOrientationW();
|
||||
changed = true;
|
||||
}
|
||||
@@ -259,7 +259,7 @@ public class Location implements Encodable, Serializable {
|
||||
return Double.isNaN(y);
|
||||
if (Double.isNaN(y))
|
||||
return false;
|
||||
return x == y;
|
||||
return Math.abs(x - y) <= 1E-7;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user