Ensure Validate has no inter-lang dependencies

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137843 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-06-01 21:25:35 +00:00
parent 2358ca2953
commit 0357030737
1 changed files with 6 additions and 5 deletions

View File

@ -35,9 +35,10 @@
* @author Gary Gregory * @author Gary Gregory
* @author Norm Deane * @author Norm Deane
* @since 2.0 * @since 2.0
* @version $Id: Validate.java,v 1.11 2004/02/19 21:04:03 fredrik Exp $ * @version $Id: Validate.java,v 1.12 2004/06/01 21:25:35 scolebourne Exp $
*/ */
public class Validate { public class Validate {
// Validate has no dependencies on other classes in Commons Lang at present
/** /**
* Constructor. This class should not normally be instantiated. * Constructor. This class should not normally be instantiated.
@ -236,7 +237,7 @@ public static void notNull(Object object) {
* @throws IllegalArgumentException if the array is empty * @throws IllegalArgumentException if the array is empty
*/ */
public static void notEmpty(Object[] array, String message) { public static void notEmpty(Object[] array, String message) {
if (ArrayUtils.isEmpty(array)) { if (array == null || array.length == 0) {
throw new IllegalArgumentException(message); throw new IllegalArgumentException(message);
} }
} }
@ -255,7 +256,7 @@ public static void notEmpty(Object[] array, String message) {
* @throws IllegalArgumentException if the array is empty * @throws IllegalArgumentException if the array is empty
*/ */
public static void notEmpty(Object[] array) { public static void notEmpty(Object[] array) {
if (ArrayUtils.isEmpty(array)) { if (array == null || array.length == 0) {
throw new IllegalArgumentException("The validated array is empty"); throw new IllegalArgumentException("The validated array is empty");
} }
} }
@ -356,7 +357,7 @@ public static void notEmpty(Map map) {
* @throws IllegalArgumentException if the string is empty * @throws IllegalArgumentException if the string is empty
*/ */
public static void notEmpty(String string, String message) { public static void notEmpty(String string, String message) {
if (StringUtils.isEmpty(string)) { if (string == null || string.length() == 0) {
throw new IllegalArgumentException(message); throw new IllegalArgumentException(message);
} }
} }
@ -375,7 +376,7 @@ public static void notEmpty(String string, String message) {
* @throws IllegalArgumentException if the string is empty * @throws IllegalArgumentException if the string is empty
*/ */
public static void notEmpty(String string) { public static void notEmpty(String string) {
if (StringUtils.isEmpty(string)) { if (string == null || string.length() == 0) {
throw new IllegalArgumentException("The validated string is empty"); throw new IllegalArgumentException("The validated string is empty");
} }
} }