Skip to content

Commit f36f135

Browse files
justin-curtis-lunaotoj
authored andcommitted
8299501: Usage of constructors of primitive wrapper classes should be avoided in java.util API docs
Reviewed-by: naoto, lancea
1 parent b8852f6 commit f36f135

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/java.base/share/classes/java/util/Arrays.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -2793,7 +2793,7 @@ public static boolean equals(boolean[] a, int aFromIndex, int aToIndex,
27932793
* two array references are considered equal if both are {@code null}.
27942794
*
27952795
* Two doubles {@code d1} and {@code d2} are considered equal if:
2796-
* <pre> {@code new Double(d1).equals(new Double(d2))}</pre>
2796+
* <pre> {@code Double.valueOf(d1).equals(Double.valueOf(d2))}</pre>
27972797
* (Unlike the {@code ==} operator, this method considers
27982798
* {@code NaN} equal to itself, and 0.0d unequal to -0.0d.)
27992799
*
@@ -2826,7 +2826,7 @@ public static boolean equals(double[] a, double[] a2) {
28262826
* in the same order.
28272827
*
28282828
* <p>Two doubles {@code d1} and {@code d2} are considered equal if:
2829-
* <pre> {@code new Double(d1).equals(new Double(d2))}</pre>
2829+
* <pre> {@code Double.valueOf(d1).equals(Double.valueOf(d2))}</pre>
28302830
* (Unlike the {@code ==} operator, this method considers
28312831
* {@code NaN} equal to itself, and 0.0d unequal to -0.0d.)
28322832
*
@@ -2876,7 +2876,7 @@ public static boolean equals(double[] a, int aFromIndex, int aToIndex,
28762876
* two array references are considered equal if both are {@code null}.
28772877
*
28782878
* Two floats {@code f1} and {@code f2} are considered equal if:
2879-
* <pre> {@code new Float(f1).equals(new Float(f2))}</pre>
2879+
* <pre> {@code Float.valueOf(f1).equals(Float.valueOf(f2))}</pre>
28802880
* (Unlike the {@code ==} operator, this method considers
28812881
* {@code NaN} equal to itself, and 0.0f unequal to -0.0f.)
28822882
*
@@ -2909,7 +2909,7 @@ public static boolean equals(float[] a, float[] a2) {
29092909
* in the same order.
29102910
*
29112911
* <p>Two floats {@code f1} and {@code f2} are considered equal if:
2912-
* <pre> {@code new Float(f1).equals(new Float(f2))}</pre>
2912+
* <pre> {@code Float.valueOf(f1).equals(Float.valueOf(f2))}</pre>
29132913
* (Unlike the {@code ==} operator, this method considers
29142914
* {@code NaN} equal to itself, and 0.0f unequal to -0.0f.)
29152915
*

0 commit comments

Comments
 (0)