LANG-1008: Change min/max methods in NumberUtils/IEEE754rUtils from array input parameters to varargs. This also closes #23 from github. Thanks to Thiago Andrade.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1593118 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10f136bb01
commit
3728344459
|
@ -22,6 +22,7 @@
|
|||
<body>
|
||||
|
||||
<release version="3.4" date="tba" description="tba">
|
||||
<action issue="LANG-1008" type="update" dev="britter" due-to="Thiago Andrade">Change min/max methods in NumberUtils/IEEE754rUtils from array input parameters to varargs</action>
|
||||
<action issue="LANG-999" type="add" dev="britter" due-to="Ben Ripkens">Add fuzzy String matching logic to StringUtils</action>
|
||||
<action issue="LANG-1006" type="update" dev="britter" due-to="Thiago Andrade">Add wrap (with String or char) to StringUtils</action>
|
||||
<action issue="LANG-1005" type="update" dev="britter" due-to="Michael Osipov">Extend DurationFormatUtils#formatDurationISO default pattern to match #formatDurationHMS</action>
|
||||
|
|
|
@ -33,8 +33,9 @@ public class IEEE754rUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from min(double[]) to min(double...)
|
||||
*/
|
||||
public static double min(final double[] array) {
|
||||
public static double min(final double... array) {
|
||||
// Validates input
|
||||
if (array == null) {
|
||||
throw new IllegalArgumentException("The Array must not be null");
|
||||
|
@ -58,8 +59,9 @@ public class IEEE754rUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from min(float[]) to min(float...)
|
||||
*/
|
||||
public static float min(final float[] array) {
|
||||
public static float min(final float... array) {
|
||||
// Validates input
|
||||
if (array == null) {
|
||||
throw new IllegalArgumentException("The Array must not be null");
|
||||
|
@ -151,8 +153,9 @@ public class IEEE754rUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from max(double[]) to max(double...)
|
||||
*/
|
||||
public static double max(final double[] array) {
|
||||
public static double max(final double... array) {
|
||||
// Validates input
|
||||
if (array== null) {
|
||||
throw new IllegalArgumentException("The Array must not be null");
|
||||
|
@ -176,8 +179,9 @@ public class IEEE754rUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from max(float[]) to max(float...)
|
||||
*/
|
||||
public static float max(final float[] array) {
|
||||
public static float max(final float... array) {
|
||||
// Validates input
|
||||
if (array == null) {
|
||||
throw new IllegalArgumentException("The Array must not be null");
|
||||
|
|
|
@ -784,8 +784,9 @@ public class NumberUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from min(long[]) to min(long...)
|
||||
*/
|
||||
public static long min(final long[] array) {
|
||||
public static long min(final long... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -807,8 +808,9 @@ public class NumberUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from min(int[]) to min(int...)
|
||||
*/
|
||||
public static int min(final int[] array) {
|
||||
public static int min(final int... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -830,8 +832,9 @@ public class NumberUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from min(short[]) to min(short...)
|
||||
*/
|
||||
public static short min(final short[] array) {
|
||||
public static short min(final short... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -853,8 +856,9 @@ public class NumberUtils {
|
|||
* @return the minimum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from min(byte[]) to min(byte...)
|
||||
*/
|
||||
public static byte min(final byte[] array) {
|
||||
public static byte min(final byte... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -877,8 +881,9 @@ public class NumberUtils {
|
|||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @see IEEE754rUtils#min(double[]) IEEE754rUtils for a version of this method that handles NaN differently
|
||||
* @since 3.4 Changed signature from min(double[]) to min(double...)
|
||||
*/
|
||||
public static double min(final double[] array) {
|
||||
public static double min(final double... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -904,8 +909,9 @@ public class NumberUtils {
|
|||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @see IEEE754rUtils#min(float[]) IEEE754rUtils for a version of this method that handles NaN differently
|
||||
* @since 3.4 Changed signature from min(float[]) to min(float...)
|
||||
*/
|
||||
public static float min(final float[] array) {
|
||||
public static float min(final float... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -932,8 +938,9 @@ public class NumberUtils {
|
|||
* @return the maximum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from max(long[]) to max(long...)
|
||||
*/
|
||||
public static long max(final long[] array) {
|
||||
public static long max(final long... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -955,8 +962,9 @@ public class NumberUtils {
|
|||
* @return the maximum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from max(int[]) to max(int...)
|
||||
*/
|
||||
public static int max(final int[] array) {
|
||||
public static int max(final int... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -978,8 +986,9 @@ public class NumberUtils {
|
|||
* @return the maximum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from max(short[]) to max(short...)
|
||||
*/
|
||||
public static short max(final short[] array) {
|
||||
public static short max(final short... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -1001,8 +1010,9 @@ public class NumberUtils {
|
|||
* @return the maximum value in the array
|
||||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @since 3.4 Changed signature from max(byte[]) to max(byte...)
|
||||
*/
|
||||
public static byte max(final byte[] array) {
|
||||
public static byte max(final byte... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -1025,8 +1035,9 @@ public class NumberUtils {
|
|||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @see IEEE754rUtils#max(double[]) IEEE754rUtils for a version of this method that handles NaN differently
|
||||
* @since 3.4 Changed signature from max(double[]) to max(double...)
|
||||
*/
|
||||
public static double max(final double[] array) {
|
||||
public static double max(final double... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
@ -1052,8 +1063,9 @@ public class NumberUtils {
|
|||
* @throws IllegalArgumentException if <code>array</code> is <code>null</code>
|
||||
* @throws IllegalArgumentException if <code>array</code> is empty
|
||||
* @see IEEE754rUtils#max(float[]) IEEE754rUtils for a version of this method that handles NaN differently
|
||||
* @since 3.4 Changed signature from max(float[]) to max(float...)
|
||||
*/
|
||||
public static float max(final float[] array) {
|
||||
public static float max(final float... array) {
|
||||
// Validates input
|
||||
validateArray(array);
|
||||
|
||||
|
|
Loading…
Reference in New Issue