From a164386b2a808b949f7bf489fdfb0c6a32ffa681 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 26 Nov 2023 14:17:02 -0500 Subject: [PATCH] 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 type attribute can be add,update,fix,remove. Set java.logging as optional module #183. + + 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. + 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