You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/12/14 15:11:31 UTC
svn commit: r890337 -
/commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Validate.java
Author: sebb
Date: Mon Dec 14 14:11:31 2009
New Revision: 890337
URL: http://svn.apache.org/viewvc?rev=890337&view=rev
Log:
Make autoboxing explicit
Modified:
commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Validate.java
Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Validate.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Validate.java?rev=890337&r1=890336&r2=890337&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Validate.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Validate.java Mon Dec 14 14:11:31 2009
@@ -119,7 +119,7 @@
*/
public static void isTrue(boolean expression, String message, long value) {
if (expression == false) {
- throw new IllegalArgumentException(String.format(message, value));
+ throw new IllegalArgumentException(String.format(message, Long.valueOf(value)));
}
}
@@ -145,7 +145,7 @@
*/
public static void isTrue(boolean expression, String message, double value) {
if (expression == false) {
- throw new IllegalArgumentException(String.format(message, value));
+ throw new IllegalArgumentException(String.format(message, new Double(value)));
}
}
@@ -517,7 +517,7 @@
Validate.notNull(array);
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
- Object[] values2 = ArrayUtils.add(values, i);
+ Object[] values2 = ArrayUtils.add(values, Integer.valueOf(i));
throw new IllegalArgumentException(String.format(message, values2));
}
}
@@ -578,7 +578,7 @@
int i = 0;
for (Iterator<?> it = iterable.iterator(); it.hasNext(); i++) {
if (it.next() == null) {
- Object[] values2 = ArrayUtils.addAll(values, i);
+ Object[] values2 = ArrayUtils.addAll(values, Integer.valueOf(i));
throw new IllegalArgumentException(String.format(message, values2));
}
}
@@ -661,7 +661,7 @@
* @see #validIndex(Object[], int, String, Object...)
*/
public static <T> T[] validIndex(T[] array, int index) {
- return validIndex(array, index, DEFAULT_VALID_INDEX_ARRAY_EXCEPTION_MESSAGE, index);
+ return validIndex(array, index, DEFAULT_VALID_INDEX_ARRAY_EXCEPTION_MESSAGE, Integer.valueOf(index));
}
// validIndex collection
@@ -712,7 +712,7 @@
* @see #validIndex(Collection, int, String, Object...)
*/
public static <T extends Collection<?>> T validIndex(T collection, int index) {
- return validIndex(collection, index, DEFAULT_VALID_INDEX_COLLECTION_EXCEPTION_MESSAGE, index);
+ return validIndex(collection, index, DEFAULT_VALID_INDEX_COLLECTION_EXCEPTION_MESSAGE, Integer.valueOf(index));
}
// validIndex string
@@ -768,7 +768,7 @@
* @see #validIndex(CharSequence, int, String, Object...)
*/
public static <T extends CharSequence> T validIndex(T chars, int index) {
- return validIndex(chars, index, DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EXCEPTION_MESSAGE, index);
+ return validIndex(chars, index, DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EXCEPTION_MESSAGE, Integer.valueOf(index));
}
}