Skip to content

Commit 33e9a89

Browse files
committed
Use Collection.isEmpty() instead of size() == 0
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1199986 13f79535-47bb-0310-9956-ffa450edef68
1 parent 63a1efe commit 33e9a89

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/org/apache/commons/io/FileSystemUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ List<String> performCommand(String[] cmdAttribs, int max, long timeout) throws I
507507
"Command line returned OS error code '" + proc.exitValue() +
508508
"' for command " + Arrays.asList(cmdAttribs));
509509
}
510-
if (lines.size() == 0) {
510+
if (lines.isEmpty()) {
511511
// unknown problem, throw exception
512512
throw new IOException(
513513
"Command line did not return any info " +

src/main/java/org/apache/commons/io/FilenameUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ static String[] splitOnTokens(String text) {
13501350
}
13511351
if (array[i] == '?') {
13521352
list.add("?");
1353-
} else if (list.size() == 0 ||
1353+
} else if (list.isEmpty() ||
13541354
(i > 0 && list.get(list.size() - 1).equals("*") == false)) {
13551355
list.add("*");
13561356
}

src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void setFileFilters(final List<IOFileFilter> fileFilters) {
116116
*/
117117
@Override
118118
public boolean accept(final File file) {
119-
if (this.fileFilters.size() == 0) {
119+
if (this.fileFilters.isEmpty()) {
120120
return false;
121121
}
122122
for (IOFileFilter fileFilter : fileFilters) {
@@ -132,7 +132,7 @@ public boolean accept(final File file) {
132132
*/
133133
@Override
134134
public boolean accept(final File file, final String name) {
135-
if (this.fileFilters.size() == 0) {
135+
if (this.fileFilters.isEmpty()) {
136136
return false;
137137
}
138138
for (IOFileFilter fileFilter : fileFilters) {

0 commit comments

Comments
 (0)