This is an automated email from the ASF dual-hosted git repository.
garydgregory 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 92a0e6096 Javadoc: Fix examples in ObjectUtils.getFirstNonNull and
BooleanUtils.toBooleanObject(Integer) (#1890)
92a0e6096 is described below
commit 92a0e60961e03e7d99ab70d87bcb35c0337b67b5
Author: Amar Ghugare <[email protected]>
AuthorDate: Thu Nov 19 17:10:34 2026 +0530
Javadoc: Fix examples in ObjectUtils.getFirstNonNull and
BooleanUtils.toBooleanObject(Integer) (#1890)
The ObjectUtils.getFirstNonNull(Supplier...) examples called a nonexistent
method firstNonNullLazy, used a lambda with an expression throw, and had an
unclosed string literal.
The BooleanUtils.toBooleanObject(Integer) example used
Integer.valueOf(null), which throws NumberFormatException before the method is
called; use (Integer) null instead.
---
src/main/java/org/apache/commons/lang3/BooleanUtils.java | 6 +++---
src/main/java/org/apache/commons/lang3/ObjectUtils.java | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/BooleanUtils.java
b/src/main/java/org/apache/commons/lang3/BooleanUtils.java
index f1dd28ad9..b76774583 100644
--- a/src/main/java/org/apache/commons/lang3/BooleanUtils.java
+++ b/src/main/java/org/apache/commons/lang3/BooleanUtils.java
@@ -652,9 +652,9 @@ public static Boolean toBooleanObject(final int value,
final int trueValue, fina
* </p>
*
* <pre>
- * BooleanUtils.toBooleanObject(Integer.valueOf(0)) = Boolean.FALSE
- * BooleanUtils.toBooleanObject(Integer.valueOf(1)) = Boolean.TRUE
- * BooleanUtils.toBooleanObject(Integer.valueOf(null)) = null
+ * BooleanUtils.toBooleanObject(Integer.valueOf(0)) = Boolean.FALSE
+ * BooleanUtils.toBooleanObject(Integer.valueOf(1)) = Boolean.TRUE
+ * BooleanUtils.toBooleanObject((Integer) null) = null
* </pre>
*
* @param value The Integer to convert
diff --git a/src/main/java/org/apache/commons/lang3/ObjectUtils.java
b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
index 90b09c534..f896c9a6e 100644
--- a/src/main/java/org/apache/commons/lang3/ObjectUtils.java
+++ b/src/main/java/org/apache/commons/lang3/ObjectUtils.java
@@ -612,11 +612,11 @@ public static <T> Class<T> getClass(final T object) {
* returns null.
*
* <pre>{@code
- * ObjectUtils.firstNonNullLazy(null, () -> null)
= null
- * ObjectUtils.firstNonNullLazy(() -> null, () -> "")
= ""
- * ObjectUtils.firstNonNullLazy(() -> "", () -> throw new
IllegalStateException()) = ""
- * ObjectUtils.firstNonNullLazy(() -> null, () -> "zz)
= "zz"
- * ObjectUtils.firstNonNullLazy()
= null
+ * ObjectUtils.getFirstNonNull(null, () -> null)
= null
+ * ObjectUtils.getFirstNonNull(() -> null, () -> "")
= ""
+ * ObjectUtils.getFirstNonNull(() -> "", () -> { throw new
IllegalStateException(); }) = ""
+ * ObjectUtils.getFirstNonNull(() -> null, () -> "zz")
= "zz"
+ * ObjectUtils.getFirstNonNull()
= null
* }</pre>
* <p>
* See also {@link Consumers#accept(Consumer, Object)} and {@link
Suppliers#get(Supplier)}.