This is an automated email from the ASF dual-hosted git repository.
sebb 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 5fbd1bd90 Deal with Spotbugs complaints from latest version
5fbd1bd90 is described below
commit 5fbd1bd9090bef99344bc927c34b92fae714457a
Author: Sebb <[email protected]>
AuthorDate: Fri Dec 8 23:10:38 2023 +0000
Deal with Spotbugs complaints from latest version
---
src/conf/spotbugs-exclude-filter.xml | 18 ++++++++++++++++++
.../org/apache/commons/lang3/SerializationUtils.java | 3 ++-
.../org/apache/commons/lang3/time/FastDatePrinter.java | 3 ++-
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/conf/spotbugs-exclude-filter.xml
b/src/conf/spotbugs-exclude-filter.xml
index 4d609e71e..af42bba2c 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -42,6 +42,24 @@
<Bug pattern="REFLF_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_FIELD" />
</Match>
+ <!-- TODO Cannot be done without breaking binary compat. -->
+ <Match>
+ <Class name="org.apache.commons.lang3.tuple.MutablePair" />
+ <Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
+ </Match>
+
+ <!-- TODO Cannot be done without breaking binary compat. -->
+ <Match>
+ <Class name="org.apache.commons.lang3.tuple.MutableTriple" />
+ <Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" />
+ </Match>
+
+ <!-- Class is deprecated; not worth the effort to fix -->
+ <Match>
+ <Class name="org.apache.commons.lang3.ThreadUtils$ThreadIdPredicate" />
+ <Bug pattern="CT_CONSTRUCTOR_THROW" />
+ </Match>
+
<!-- https://github.com/spotbugs/spotbugs/issues/1504 -->
<Match>
<Class name="org.apache.commons.lang3.ArrayUtils" />
diff --git a/src/main/java/org/apache/commons/lang3/SerializationUtils.java
b/src/main/java/org/apache/commons/lang3/SerializationUtils.java
index 7ab6a1124..acad6f0a1 100644
--- a/src/main/java/org/apache/commons/lang3/SerializationUtils.java
+++ b/src/main/java/org/apache/commons/lang3/SerializationUtils.java
@@ -60,7 +60,8 @@ public class SerializationUtils {
* <p>For more in-depth information about the problem for which this
* class here is a workaround, see the JIRA issue LANG-626.</p>
*/
- static class ClassLoaderAwareObjectInputStream extends ObjectInputStream {
+ static final class ClassLoaderAwareObjectInputStream extends
ObjectInputStream {
+ // Note: This is final to avoid Spotbugs CT_CONSTRUCTOR_THROW
private static final Map<String, Class<?>> primitiveTypes =
new HashMap<>();
diff --git a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
index 6b8ca94d8..3e78f42d2 100644
--- a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
+++ b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
@@ -254,7 +254,8 @@ public class FastDatePrinter implements DatePrinter,
Serializable {
/**
* Inner class to output a padded number.
*/
- private static class PaddedNumberField implements NumberRule {
+ private final static class PaddedNumberField implements NumberRule {
+ // Note: This is final to avoid Spotbugs CT_CONSTRUCTOR_THROW
private final int field;
private final int size;