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 2024/06/30 12:06:29 UTC
(commons-logging) 03/05: Fix NullPointerException in SimpleLog#write(StringBuffer) on null input
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-logging.git
commit 03ec597a10b447165d0afa168d753af73b833268
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 30 08:02:35 2024 -0400
Fix NullPointerException in SimpleLog#write(StringBuffer) on null input
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/commons/logging/impl/SimpleLog.java | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 31c8fcc..f5b898a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -48,6 +48,7 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in SimpleLog.</action>
<action dev="ggregory" type="fix" issue="LOGGING-193" due-to="Philippe Marschall">Update Log4j 2 Imports #268.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix NullPointerException in SimpleLog#write(Object) on null input.</action>
+ <action dev="ggregory" type="fix" due-to="Gary Gregory">Fix NullPointerException in SimpleLog#write(StringBuffer) on null input.</action>
<!-- ADD -->
<!-- UPDATE -->
<action dev="ggregory" type="update" due-to="Dependabot">Bump org.apache.commons:commons-parent from 69 to 71 #267.</action>
diff --git a/src/main/java/org/apache/commons/logging/impl/SimpleLog.java b/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
index 97580fe..541e9ac 100644
--- a/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
+++ b/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
@@ -653,7 +653,7 @@ public class SimpleLog implements Log, Serializable {
* text to be logged
*/
protected void write(final StringBuffer buffer) {
- System.err.println(buffer.toString());
+ System.err.println(Objects.toString(buffer));
}
}