Skip to content

Commit

Permalink
[IO-571] Remove redundant isDirectory() check in
Browse files Browse the repository at this point in the history
org.apache.commons.io.FileUtils.listFilesAndDirs(File, IOFileFilter,
IOFileFilter).
  • Loading branch information
garydgregory committed Mar 8, 2018
1 parent d24dd1a commit 71fc2c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ The <action> type attribute can be add,update,fix,remove.
<action issue="IO-570" dev="ggregory" type="fix" due-to="Pranet Verma">
Missing Javadoc in FilenameUtils causing Travis-CI build to fail.
</action>
<action issue="IO-571" dev="ggregory" type="fix" due-to="pranet">
Remove redundant isDirectory() check in org.apache.commons.io.FileUtils.listFilesAndDirs(File, IOFileFilter, IOFileFilter).
</action>
</release>

<release version="2.6" date="2017-10-15" description="Java 7 required, Java 9 supported.">
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/apache/commons/io/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,7 @@ public static Collection<File> listFilesAndDirs(

//Find files
final Collection<File> files = new java.util.LinkedList<>();
if (directory.isDirectory()) {
files.add(directory);
}
files.add(directory);
innerListFiles(files, directory,
FileFilterUtils.or(effFileFilter, effDirFilter), true);
return files;
Expand Down

0 comments on commit 71fc2c4

Please sign in to comment.