You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/03/26 17:43:13 UTC
[commons-lang] branch master updated: Updating javadoc for NullPointerException when Validate.notNull() is called (#870)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new d5fef1e Updating javadoc for NullPointerException when Validate.notNull() is called (#870)
d5fef1e is described below
commit d5fef1e78469cb517cbe3a0af410802e0679ce44
Author: Diego Marcilio <dv...@gmail.com>
AuthorDate: Sat Mar 26 18:43:05 2022 +0100
Updating javadoc for NullPointerException when Validate.notNull() is called (#870)
---
.../java/org/apache/commons/lang3/CharRange.java | 2 +-
.../java/org/apache/commons/lang3/ThreadUtils.java | 24 ++++++++++++----------
.../concurrent/MultiBackgroundInitializer.java | 3 ++-
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/CharRange.java b/src/main/java/org/apache/commons/lang3/CharRange.java
index 3a1fd18..eae5196 100644
--- a/src/main/java/org/apache/commons/lang3/CharRange.java
+++ b/src/main/java/org/apache/commons/lang3/CharRange.java
@@ -184,7 +184,7 @@ final class CharRange implements Iterable<Character>, Serializable {
*
* @param range the range to check against
* @return {@code true} if this range entirely contains the input range
- * @throws IllegalArgumentException if {@code null} input
+ * @throws NullPointerException if {@code null} input
*/
public boolean contains(final CharRange range) {
Validate.notNull(range, "range");
diff --git a/src/main/java/org/apache/commons/lang3/ThreadUtils.java b/src/main/java/org/apache/commons/lang3/ThreadUtils.java
index f8b8587..ebecc76 100644
--- a/src/main/java/org/apache/commons/lang3/ThreadUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ThreadUtils.java
@@ -68,7 +68,7 @@ public class ThreadUtils {
* Predicate constructor
*
* @param name thread or thread group name
- * @throws IllegalArgumentException if the name is {@code null}
+ * @throws NullPointerException if the name is {@code null}
*/
public NamePredicate(final String name) {
Validate.notNull(name, "name");
@@ -171,7 +171,8 @@ public class ThreadUtils {
* @param threadGroupName The thread group name
* @return The threads which belongs to a thread group with the specified group name and the thread's id match the specified id.
* {@code null} is returned if no such thread exists
- * @throws IllegalArgumentException if the specified id is zero or negative or the group name is null
+ * @throws NullPointerException if the group name is null
+ * @throws IllegalArgumentException if the specified id is zero or negative
* @throws SecurityException
* if the current thread cannot access the system thread group
*
@@ -194,7 +195,8 @@ public class ThreadUtils {
* @param threadGroup The thread group
* @return The thread which belongs to a specified thread group and the thread's id match the specified id.
* {@code null} is returned if no such thread exists
- * @throws IllegalArgumentException if the specified id is zero or negative or the group is null
+ * @throws NullPointerException if {@code threadGroup == null}
+ * @throws IllegalArgumentException if the specified id is zero or negative
* @throws SecurityException
* if the current thread cannot access the system thread group
*
@@ -217,7 +219,7 @@ public class ThreadUtils {
* @param recurse if {@code true} then evaluate the predicate recursively on all thread groups in all subgroups of the given group
* @param predicate the predicate
* @return An unmodifiable {@code Collection} of active thread groups which match the given predicate and which is a subgroup of the given thread group
- * @throws IllegalArgumentException if the given group or predicate is null
+ * @throws NullPointerException if the given group or predicate is null
* @throws SecurityException if the current thread cannot modify
* thread groups from this thread's thread group up to the system thread group
*/
@@ -247,7 +249,7 @@ public class ThreadUtils {
*
* @param predicate the predicate
* @return An unmodifiable {@code Collection} of active thread groups matching the given predicate
- * @throws IllegalArgumentException if the predicate is null
+ * @throws NullPointerException if the predicate is null
* @throws SecurityException
* if the current thread cannot access the system thread group
* @throws SecurityException if the current thread cannot modify
@@ -262,7 +264,7 @@ public class ThreadUtils {
*
* @param threadGroupName The thread group name
* @return the thread groups with the specified group name or an empty collection if no such thread group exists. The collection returned is always unmodifiable.
- * @throws IllegalArgumentException if group name is null
+ * @throws NullPointerException if group name is null
* @throws SecurityException
* if the current thread cannot access the system thread group
*
@@ -280,7 +282,7 @@ public class ThreadUtils {
* @param recurse if {@code true} then evaluate the predicate recursively on all threads in all subgroups of the given group
* @param predicate the predicate
* @return An unmodifiable {@code Collection} of active threads which match the given predicate and which belongs to the given thread group
- * @throws IllegalArgumentException if the given group or predicate is null
+ * @throws NullPointerException if the given group or predicate is null
* @throws SecurityException if the current thread cannot modify
* thread groups from this thread's thread group up to the system thread group
*/
@@ -311,7 +313,7 @@ public class ThreadUtils {
* @param predicate the predicate
* @return An unmodifiable {@code Collection} of active threads matching the given predicate
*
- * @throws IllegalArgumentException if the predicate is null
+ * @throws NullPointerException if the predicate is null
* @throws SecurityException
* if the current thread cannot access the system thread group
* @throws SecurityException if the current thread cannot modify
@@ -326,7 +328,7 @@ public class ThreadUtils {
*
* @param threadName The thread name
* @return The threads with the specified name or an empty collection if no such thread exists. The collection returned is always unmodifiable.
- * @throws IllegalArgumentException if the specified name is null
+ * @throws NullPointerException if the specified name is null
* @throws SecurityException
* if the current thread cannot access the system thread group
*
@@ -344,7 +346,7 @@ public class ThreadUtils {
* @param threadGroupName The thread group name
* @return The threads which belongs to a thread group with the specified group name and the thread's name match the specified name,
* An empty collection is returned if no such thread exists. The collection returned is always unmodifiable.
- * @throws IllegalArgumentException if the specified thread name or group name is null
+ * @throws NullPointerException if the specified thread name or group name is null
* @throws SecurityException
* if the current thread cannot access the system thread group
*
@@ -376,7 +378,7 @@ public class ThreadUtils {
* @param threadGroup The thread group
* @return The threads which belongs to a thread group and the thread's name match the specified name,
* An empty collection is returned if no such thread exists. The collection returned is always unmodifiable.
- * @throws IllegalArgumentException if the specified thread name or group is null
+ * @throws NullPointerException if the specified thread name or group is null
* @throws SecurityException
* if the current thread cannot access the system thread group
*
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
index 08c9b34..d627526 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
@@ -128,7 +128,8 @@ public class MultiBackgroundInitializer
* @param name the name of the initializer (must not be <b>null</b>)
* @param backgroundInitializer the {@code BackgroundInitializer} to add (must not be
* <b>null</b>)
- * @throws IllegalArgumentException if a required parameter is missing
+ * @throws NullPointerException if either {@code name} or {@code backgroundInitializer}
+ * is {@code null}
* @throws IllegalStateException if {@code start()} has already been called
*/
public void addInitializer(final String name, final BackgroundInitializer<?> backgroundInitializer) {