diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 24b75e50421..a0d4e4e1c8a 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -62,6 +62,8 @@ The type attribute can be add,update,fix,remove. 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. Fix SpotBugs error: org.apache.commons.io.FileCleaningTracker.getDeleteFailures() may expose internal representation by returning FileCleaningTracker.deleteFailures [org.apache.commons.io.FileCleaningTracker] At FileCleaningTracker.java:[line 218] EI_EXPOSE_REP. + Fix SpotBugs error: org.apache.commons.io.IOExceptionList.getCauseList() may expose internal representation by returning IOExceptionList.causeList [org.apache.commons.io.IOExceptionList] At IOExceptionList.java:[line 118] EI_EXPOSE_REP. + Fix SpotBugs error: org.apache.commons.io.IOExceptionList.getCauseList(Class) may expose internal representation by returning IOExceptionList.causeList [org.apache.commons.io.IOExceptionList] At IOExceptionList.java:[line 129] EI_EXPOSE_REP. 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/IOExceptionList.java b/src/main/java/org/apache/commons/io/IOExceptionList.java index 8ee519b5123..c8bd4bf99c7 100644 --- a/src/main/java/org/apache/commons/io/IOExceptionList.java +++ b/src/main/java/org/apache/commons/io/IOExceptionList.java @@ -18,6 +18,7 @@ package org.apache.commons.io; import java.io.IOException; +import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -115,7 +116,7 @@ public T getCause(final int index, final Class clazz) { * @return The list of causes. */ public List getCauseList() { - return (List) causeList; + return (List) new ArrayList<>(causeList); } /** @@ -126,7 +127,7 @@ public List getCauseList() { * @return The list of causes. */ public List getCauseList(final Class clazz) { - return (List) causeList; + return (List) new ArrayList<>(causeList); } @Override