Author: niallp
Date: Mon Feb 1 16:29:45 2010
New Revision: 905327
URL: http://svn.apache.org/viewvc?rev=905327&view=rev
Log:
Re-order notNull() methods
Modified:
commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Validate.java
Modified:
commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Validate.java
URL:
http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Validate.java?rev=905327&r1=905326&r2=905327&view=diff
==============================================================================
---
commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Validate.java
(original)
+++
commons/proper/lang/branches/LANG_2_X/src/main/java/org/apache/commons/lang/Validate.java
Mon Feb 1 16:29:45 2010
@@ -164,34 +164,34 @@
/**
* <p>Validate that the specified argument is not <code>null</code>;
- * otherwise throwing an exception with the specified message.
+ * otherwise throwing an exception.
*
- * <pre>Validate.notNull(myObject, "The object must not be null");</pre>
+ * <pre>Validate.notNull(myObject);</pre>
+ *
+ * <p>The message of the exception is "The validated object is
+ * null".</p>
*
* @param object the object to check
- * @param message the exception message if invalid
+ * @throws IllegalArgumentException if the object is <code>null</code>
*/
- public static void notNull(Object object, String message) {
+ public static void notNull(Object object) {
if (object == null) {
- throw new IllegalArgumentException(message);
+ throw new IllegalArgumentException("The validated object is null");
}
}
/**
* <p>Validate that the specified argument is not <code>null</code>;
- * otherwise throwing an exception.
- *
- * <pre>Validate.notNull(myObject);</pre>
+ * otherwise throwing an exception with the specified message.
*
- * <p>The message of the exception is "The validated object is
- * null".</p>
+ * <pre>Validate.notNull(myObject, "The object must not be null");</pre>
*
* @param object the object to check
- * @throws IllegalArgumentException if the object is <code>null</code>
+ * @param message the exception message if invalid
*/
- public static void notNull(Object object) {
+ public static void notNull(Object object, String message) {
if (object == null) {
- throw new IllegalArgumentException("The validated object is null");
+ throw new IllegalArgumentException(message);
}
}