Usage of factory method is recommended.
Thanks to "ranjan1423".
Closes
@@ -59,7 +59,7 @@ public final class MathUtils {
* @return the hash code
*/
public static int hash(double value) {
- return new Double(value).hashCode();
+ return Double.valueOf(value).hashCode();
}
/**
@@ -68,10 +68,10 @@ public final class MathUtils {
*
* @param x Value
* @param y Value
- * @return {@code new Double(x).equals(new Double(y))}
+ * @return {@code Double.valueOf(x).equals(Double.valueOf(y))}
*/
public static boolean equals(double x, double y) {
- return new Double(x).equals(new Double(y));
+ return Double.valueOf(x).equals(Double.valueOf(y));
}
/**
