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


The following commit(s) were added to refs/heads/master by this push:
     new a164386  Fix SpotBugs [ERROR] Medium
a164386 is described below

commit a164386b2a808b949f7bf489fdfb0c6a32ffa681
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Nov 26 14:17:02 2023 -0500

    Fix SpotBugs [ERROR] Medium
    
    Switch statement found in
    org.apache.commons.logging.impl.SimpleLog.log(int, Object, Throwable)
    where default case is missing
    [org.apache.commons.logging.impl.SimpleLog] At SimpleLog.java:[lines
    505-522] SF_SWITCH_NO_DEFAULT
---
 src/changes/changes.xml                                      | 3 +++
 src/main/java/org/apache/commons/logging/impl/SimpleLog.java | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 3571a8d..d1ec201 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -101,6 +101,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Piotr P. Karwasz">
         Set java.logging as optional module #183.
       </action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">
+        Fix SpotBugs [ERROR] Medium: Switch statement found in 
org.apache.commons.logging.impl.SimpleLog.log(int, Object, Throwable) where 
default case is missing [org.apache.commons.logging.impl.SimpleLog] At 
SimpleLog.java:[lines 505-522] SF_SWITCH_NO_DEFAULT.
+      </action>
       <!-- UPDATE -->
       <action dev="ggregory" type="update" due-to="Gary Gregory">
         Bump Java from 6 to 8.
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 c731618..b3a845f 100644
--- a/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
+++ b/src/main/java/org/apache/commons/logging/impl/SimpleLog.java
@@ -521,6 +521,10 @@ public class SimpleLog implements Log, Serializable {
         case SimpleLog.LOG_LEVEL_FATAL:
             buf.append("[FATAL] ");
             break;
+        default:
+            // Or throw?
+            buf.append("[UNDEFINED] ");
+            break;
         }
 
         // Append the name of the log instance if so configured

Reply via email to