From c39be8e39a24198725a105170464b74c40ba1083 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 23 Nov 2023 11:57:05 -0500 Subject: [PATCH] Fix SpotBugs errors - [ERROR] Medium: Class org.apache.commons.io.monitor.FileAlterationObserver defines non-transient non-serializable instance field fileFilter [org.apache.commons.io.monitor.FileAlterationObserver] In FileAlterationObserver.java SE_BAD_FIELD - [ERROR] Medium: Class org.apache.commons.io.monitor.FileAlterationObserver defines non-transient non-serializable instance field listeners [org.apache.commons.io.monitor.FileAlterationObserver] In FileAlterationObserver.java SE_BAD_FIELD --- src/changes/changes.xml | 2 ++ .../org/apache/commons/io/monitor/FileAlterationObserver.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6518d1dcde0..741fd2d9cf2 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -59,6 +59,8 @@ The type attribute can be add,update,fix,remove. Fix SpotBugs error: Class org.apache.commons.io.filefilter.DelegateFileFilter defines non-transient non-serializable instance field fileFilter [org.apache.commons.io.filefilter.DelegateFileFilter] In DelegateFileFilter.java SE_BAD_FIELD. Fix SpotBugs error: Class org.apache.commons.io.filefilter.DelegateFileFilter defines non-transient non-serializable instance field fileNameFilter [org.apache.commons.io.filefilter.DelegateFileFilter] In DelegateFileFilter.java SE_BAD_FIELD. Fix SpotBugs error: org.apache.commons.io.function.IOStream$1.next() cannot throw NoSuchElementException [org.apache.commons.io.function.IOStream$1] At IOStream.java:[line 98] IT_NO_SUCH_ELEMENT. + Fix SpotBugs error: Class org.apache.commons.io.monitor.FileAlterationObserver defines non-transient non-serializable instance field fileFilter [org.apache.commons.io.monitor.FileAlterationObserver] In FileAlterationObserver.java SE_BAD_FIELD. + Fix SpotBugs error: Class org.apache.commons.io.monitor.FileAlterationObserver defines non-transient non-serializable instance field listeners [org.apache.commons.io.monitor.FileAlterationObserver] In FileAlterationObserver.java SE_BAD_FIELD. Bump org.codehaus.mojo:exec-maven-plugin from 3.1.0 to 3.1.1 #512. Bump commons-lang3 from 3.13.0 to 3.14.0. diff --git a/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java b/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java index d34e825b128..33311b53d1c 100644 --- a/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java +++ b/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java @@ -128,9 +128,9 @@ public class FileAlterationObserver implements Serializable { private static final long serialVersionUID = 1185122225658782848L; - private final List listeners = new CopyOnWriteArrayList<>(); + private transient final List listeners = new CopyOnWriteArrayList<>(); private final FileEntry rootEntry; - private final FileFilter fileFilter; + private transient final FileFilter fileFilter; private final Comparator comparator; /**