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 85984503b [LANG-1840] Fix NPE in MultilineRecursiveToStringStyle for
null map entries (#1889)
85984503b is described below
commit 85984503becf3bab2f701990bf47610f6aff6d1d
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Nov 19 06:37:51 2026 -0500
[LANG-1840] Fix NPE in MultilineRecursiveToStringStyle for null map
entries (#1889)
Clarify that appendDetail accepts null and appends the literal "null",
overriding the inherited non-null parameter description.
Assisted-By: Codex
---
src/changes/changes.xml | 1 +
.../commons/lang3/builder/MultilineRecursiveToStringStyle.java | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e4920740e..ea24d3d64 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -109,6 +109,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory,
joao-jordy">Avoid repeated array prefix copies in
ClassUtils.getShortClassName(String) (#1886).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory,
joao-jordy">Throw IllegalArgumentException instead of
StringIndexOutOfBoundsException for bracket-only names in
ClassUtils.getPackageName(String) and getShortClassName(String)
(#1887).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory,
Amar Ghugare">Clear stale stop timestamps when restarting StopWatch after
reset(), and clarify stop timestamp getter Javadoc (#1888).</action>
+ <action type="fix" dev="ggregory" due-to="Gary Gregory,
Amar Ghugare" issue="LANG-1840">Fix NPE in MultilineRecursiveToStringStyle for
null map entries (#1889).</action>
<!-- ADD -->
<!-- UPDATE -->
</release>
diff --git
a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
index 33c48e5e6..b20985092 100644
---
a/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
+++
b/src/main/java/org/apache/commons/lang3/builder/MultilineRecursiveToStringStyle.java
@@ -149,6 +149,15 @@ protected void appendDetail(final StringBuffer buffer,
final String fieldName, f
resetIndent();
}
+ /**
+ * {@inheritDoc}
+ *
+ * <p>
+ * If {@code value} is {@code null}, appends the literal {@code "null"}.
+ * </p>
+ *
+ * @param value The value to add to the {@code toString}, may be {@code
null}.
+ */
@Override
public void appendDetail(final StringBuffer buffer, final String
fieldName, final Object value) {
if (value != null && !ClassUtils.isPrimitiveWrapper(value.getClass())
&& !String.class.equals(value.getClass())