You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2020/11/16 13:45:29 UTC

[commons-math] branch master updated: Usage of factory method is recommended.

This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git


The following commit(s) were added to refs/heads/master by this push:
     new a33cc0b  Usage of factory method is recommended.
a33cc0b is described below

commit a33cc0b142ead497c4389e03083d644370b01db3
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Mon Nov 16 14:42:13 2020 +0100

    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 3031465..10dc1fe 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));
     }
 
     /**