From a33cc0b142ead497c4389e03083d644370b01db3 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Mon, 16 Nov 2020 14:42:13 +0100 Subject: [PATCH] Usage of factory method is recommended. Thanks to "ranjan1423". Closes #165. --- src/main/java/org/apache/commons/math4/util/MathUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/math4/util/MathUtils.java b/src/main/java/org/apache/commons/math4/util/MathUtils.java index 303146597..10dc1fec0 100644 --- a/src/main/java/org/apache/commons/math4/util/MathUtils.java +++ b/src/main/java/org/apache/commons/math4/util/MathUtils.java @@ -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)); } /**