commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1199986 - in /commons/proper/io/trunk/src/main/java/org/apache/commons/io: FileSystemUtils.java FilenameUtils.java filefilter/AndFileFilter.java
Date Wed, 09 Nov 2011 21:43:44 GMT
Author: ggregory
Date: Wed Nov  9 21:43:44 2011
New Revision: 1199986

URL: http://svn.apache.org/viewvc?rev=1199986&view=rev
Log:
Use Collection.isEmpty() instead of size() == 0

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java?rev=1199986&r1=1199985&r2=1199986&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java Wed Nov
 9 21:43:44 2011
@@ -507,7 +507,7 @@ public class FileSystemUtils {
                         "Command line returned OS error code '" + proc.exitValue() +
                         "' for command " + Arrays.asList(cmdAttribs));
             }
-            if (lines.size() == 0) {
+            if (lines.isEmpty()) {
                 // unknown problem, throw exception
                 throw new IOException(
                         "Command line did not return any info " +

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java?rev=1199986&r1=1199985&r2=1199986&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java Wed Nov
 9 21:43:44 2011
@@ -1350,7 +1350,7 @@ public class FilenameUtils {
                 }
                 if (array[i] == '?') {
                     list.add("?");
-                } else if (list.size() == 0 ||
+                } else if (list.isEmpty() ||
                         (i > 0 && list.get(list.size() - 1).equals("*") == false))
{
                     list.add("*");
                 }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java?rev=1199986&r1=1199985&r2=1199986&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java
Wed Nov  9 21:43:44 2011
@@ -116,7 +116,7 @@ public class AndFileFilter
      */
     @Override
     public boolean accept(final File file) {
-        if (this.fileFilters.size() == 0) {
+        if (this.fileFilters.isEmpty()) {
             return false;
         }
         for (IOFileFilter fileFilter : fileFilters) {
@@ -132,7 +132,7 @@ public class AndFileFilter
      */
     @Override
     public boolean accept(final File file, final String name) {
-        if (this.fileFilters.size() == 0) {
+        if (this.fileFilters.isEmpty()) {
             return false;
         }
         for (IOFileFilter fileFilter : fileFilters) {



Mime
View raw message