Fixing squid:S1201- Methods named "equals" should override Object.equals(Object)

This commit is contained in:
Faisal Hameed
2016-02-12 09:50:37 +05:00
parent 28045975a1
commit ae058cdcbf
2 changed files with 6 additions and 6 deletions
@@ -79,7 +79,7 @@ abstract class ContinuedFraction {
double hPrev = getA(0, x);
// use the value of small as epsilon criteria for zero checks
if (Precision.equals(hPrev, 0.0, small)) {
if (Precision.isEquals(hPrev, 0.0, small)) {
hPrev = small;
}
@@ -93,11 +93,11 @@ abstract class ContinuedFraction {
final double b = getB(n, x);
double dN = a + b * dPrev;
if (Precision.equals(dN, 0.0, small)) {
if (Precision.isEquals(dN, 0.0, small)) {
dN = small;
}
double cN = a + b / cPrev;
if (Precision.equals(cN, 0.0, small)) {
if (Precision.isEquals(cN, 0.0, small)) {
cN = small;
}
@@ -38,8 +38,8 @@ class Precision {
* @return {@code true} if the values are two adjacent floating point
* numbers or they are within range of each other.
*/
public static boolean equals(double x, double y, double eps) {
return equals(x, y, 1) || Math.abs(y - x) <= eps;
public static boolean isEquals(double x, double y, double eps) {
return isEquals(x, y, 1) || Math.abs(y - x) <= eps;
}
/**
@@ -63,7 +63,7 @@ class Precision {
* @return {@code true} if there are fewer than {@code maxUlps} floating
* point values between {@code x} and {@code y}.
*/
public static boolean equals(final double x, final double y, final int maxUlps) {
public static boolean isEquals(final double x, final double y, final int maxUlps) {
final long xInt = Double.doubleToRawLongBits(x);
final long yInt = Double.doubleToRawLongBits(y);