Tidy up spotbugs exclude filter
DELETE
findbugs-exclude-filter.xml
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!--
- This file contains some false positive bugs detected by findbugs. Their
- false positive nature has been analyzed individually and they have been
- put here to instruct findbugs it must ignore them.
--->
-<FindBugsFilter>
-
-
- <!-- See discussion on https://issues.apache.org/jira/browse/IO-215 -->
- <Match>
- <Class name="org.apache.commons.io.FileUtils" />
- <Or>
- <Method name="doCopyDirectory" params="java.io.File,java.io.File,java.io.FileFilter,boolean,java.util.List" returns="void" />
- <Method name="doCopyFile" params="java.io.File,java.io.File,boolean" returns="void" />
- </Or>
- <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
- </Match>
-
-
- <!--
- Ignoring the return from mkdirs() is a false positives since the
- following line in both those methods checks for the existence of
- the directory and throws an exception if it doesn't exist.
- -->
- <Match>
- <Class name="org.apache.commons.io.FileUtils" />
- <Or>
- <Method name="moveDirectoryToDirectory" params="java.io.File,java.io.File,boolean" returns="void" />
- <Method name="moveFileToDirectory" params="java.io.File,java.io.File,boolean" returns="void" />
- </Or>
- <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
- </Match>
-
-
- <!--
- FileEntry is used internally by FileAlterationObserver to refresh and
- update the state of files it is monitoring and in that context this is
- not an issue. If people re-use it elsewhere then they need to
- take care - but its not its primary purpose here and so its OK
- -->
- <Match>
- <Class name="org.apache.commons.io.monitor.FileEntry" />
- <Method name="setChildren" params="org.apache.commons.io.monitor.FileEntry[]" returns="void" />
- <Bug pattern="EI_EXPOSE_REP2" />
- </Match>
-
-
- <!-- See discussion on https://issues.apache.org/jira/browse/IO-214 -->
- <Match>
- <Class name="org.apache.commons.io.output.ByteArrayOutputStream" />
- <Bug pattern="IS2_INCONSISTENT_SYNC" />
- </Match>
-
-
- <!-- This is a false positive since close() does nothing in the Stream implementation being used -->
- <Match>
- <Class name="org.apache.commons.io.output.ByteArrayOutputStream" />
- <Method name="toBufferedInputStream" params="java.io.InputStream" returns="java.io.InputStream" />
- <Bug pattern="OS_OPEN_STREAM" />
- </Match>
-
-
- <!-- See discussion on https://issues.apache.org/jira/browse/IO-216 -->
- <Match>
- <Class name="org.apache.commons.io.output.LockableFileWriter" />
- <Method name="close" params="" returns="void" />
- <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
- </Match>
-
- <Match>
- <Class name="org.apache.commons.io.output.DeferredFileOutputStream" />
- <Or>
- <Method name="thresholdReached" params="" returns="void" />
- </Or>
- <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
- </Match>
-</FindBugsFilter>

MODIFY
pom.xml
pom.xml
@@ -403,7 +403,7 @@ file comparators, endian transformation classes, and much more.
</dependency>
</dependencies>
<configuration>
- <excludeFilterFile>${basedir}/sb-excludes.xml</excludeFilterFile>
+ <excludeFilterFile>${basedir}/spotbugs-exclude-filter.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
@@ -425,7 +425,7 @@ file comparators, endian transformation classes, and much more.
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.plugin.version}</version>
<configuration>
- <excludeFilterFile>${basedir}/sb-excludes.xml</excludeFilterFile>
+ <excludeFilterFile>${basedir}/spotbugs-exclude-filter.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>

RENAME
sb-excludes.xml
spotbugs-exclude-filter.xml
-->
<FindBugsFilter>
+ <!-- See discussion on https://issues.apache.org/jira/browse/IO-216 -->
+ <Match>
+ <Class name="org.apache.commons.io.output.LockableFileWriter" />
+ <Method name="close" params="" returns="void" />
+ <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
+ </Match>
+
+ <!-- The constructors intentionally do not copy the input byte array -->
+ <Match>
+ <Class name="org.apache.commons.io.input.UnsynchronizedByteArrayInputStream" />
+ <Method name="&lt;init&gt;" />
+ <Bug pattern="EI_EXPOSE_REP2" />
+ </Match>
+
+ <!-- The encoding is irrelevant as output is binned -->
+ <Match>
+ <Class name="org.apache.commons.io.output.NullPrintStream" />
+ <Bug pattern="DM_DEFAULT_ENCODING" />
+ </Match>
</FindBugsFilter>

Tidy up spotbugs exclude filter