You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/09 16:43:20 UTC

(commons-lang) branch master updated: Javadoc: Clarify clone() methods

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 96438a1f5 Javadoc: Clarify clone() methods
96438a1f5 is described below

commit 96438a1f56341e3bbcf30b83c666a7fb56f854d4
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 9 11:43:15 2023 -0500

    Javadoc: Clarify clone() methods
---
 .../java/org/apache/commons/lang3/ArrayUtils.java  | 50 +++++++++-------------
 1 file changed, 20 insertions(+), 30 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java
index b7abff0ca..99dfb0498 100644
--- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java
@@ -1366,13 +1366,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static boolean[] clone(final boolean[] array) {
@@ -1380,13 +1379,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static byte[] clone(final byte[] array) {
@@ -1394,13 +1392,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static char[] clone(final char[] array) {
@@ -1408,13 +1405,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static double[] clone(final double[] array) {
@@ -1422,13 +1418,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static float[] clone(final float[] array) {
@@ -1436,13 +1431,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static int[] clone(final int[] array) {
@@ -1450,13 +1444,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static long[] clone(final long[] array) {
@@ -1464,13 +1457,12 @@ public class ArrayUtils {
     }
 
     /**
-     * Clones an array returning a typecast result and handling
-     * {@code null}.
+     * Clones an array or returns {@code null}.
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param array  the array to clone, may be {@code null}
+     * @param array the array to clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static short[] clone(final short[] array) {
@@ -1478,18 +1470,16 @@ public class ArrayUtils {
     }
 
     /**
-     * Shallow clones an array returning a typecast result and handling
-     * {@code null}.
+     * Shallow clones an array or returns {@code null}.
      * <p>
-     * The objects in the array are not cloned, thus there is no special
-     * handling for multi-dimensional arrays.
+     * The objects in the array are not cloned, thus there is no special handling for multi-dimensional arrays.
      * </p>
      * <p>
      * This method returns {@code null} for a {@code null} input array.
      * </p>
      *
-     * @param <T> the component type of the array
-     * @param array  the array to shallow clone, may be {@code null}
+     * @param <T>   the component type of the array
+     * @param array the array to shallow clone, may be {@code null}
      * @return the cloned array, {@code null} if {@code null} input
      */
     public static <T> T[] clone(final T[] array) {