garydgregory commented on a change in pull request #716:
URL: https://github.com/apache/commons-lang/pull/716#discussion_r581096583
##########
File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java
##########
@@ -263,6 +267,23 @@ public static Boolean negate(final Boolean bool) {
return bool.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
}
+ /**
+ * <p>Validate that the specified argument array is neither {@code null}
+ * nor a length of zero (no elements); otherwise throwing an exception.
+ *
+ * @param array an array of {@code boolean}s
+ * @throws IllegalArgumentException if {@code array} is {@code null}
+ * @throws IllegalArgumentException if {@code array} is empty.
+ */
+ private static void notNullOrEmpty(final boolean... array){
+ if (array == null) {
Review comment:
Hi @arturobernalg
I think we should converge all null checks to `Objects.requireNonNull(arg,
"arg")`, which also avoids making our exception messages too English-centric.
In the same vein, I'd call this new method `requireNotEmpty`.
##########
File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java
##########
@@ -29,7 +29,18 @@
* @since 2.0
*/
public class BooleanUtils {
-
+ /**
+ * The default message for null array.
+ *
+ * @since 3.12.0
Review comment:
No need for since tag for private elements.
##########
File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java
##########
@@ -29,7 +29,18 @@
* @since 2.0
*/
public class BooleanUtils {
-
+ /**
+ * The default message for null array.
+ *
+ * @since 3.12.0
+ */
+ private static final String DEFAULT_NULL_ARRAY_EX_MESSAGE = "The Array
must not be null";
+ /**
+ * The default message for empty array.
+ *
+ * @since 3.12.0
+ */
+ private static final String DEFAULT_EMPTY_ARRAY_EX_MESSAGE = "Array is
empty";
Review comment:
Simplify to "Empty array".
##########
File path: src/main/java/org/apache/commons/lang3/BooleanUtils.java
##########
@@ -29,7 +29,18 @@
* @since 2.0
*/
public class BooleanUtils {
-
+ /**
+ * The default message for null array.
+ *
+ * @since 3.12.0
+ */
+ private static final String DEFAULT_NULL_ARRAY_EX_MESSAGE = "The Array
must not be null";
+ /**
+ * The default message for empty array.
+ *
+ * @since 3.12.0
Review comment:
No need for since tag for private elements.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]