commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-io] branch master updated: Rename internal class from ReverseComparator to ReverseFileComparator.
Date Sun, 02 Aug 2020 21:46:31 GMT
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new e8afd47  Rename internal class from ReverseComparator to ReverseFileComparator.
e8afd47 is described below

commit e8afd478fb060f677c246b54aa27516b28075995
Author: Gary Gregory <gardgregory@gmail.com>
AuthorDate: Sun Aug 2 17:46:23 2020 -0400

    Rename internal class from ReverseComparator to ReverseFileComparator.
---
 .../org/apache/commons/io/comparator/DefaultFileComparator.java     | 2 +-
 .../org/apache/commons/io/comparator/DirectoryFileComparator.java   | 2 +-
 .../org/apache/commons/io/comparator/ExtensionFileComparator.java   | 6 +++---
 .../apache/commons/io/comparator/LastModifiedFileComparator.java    | 2 +-
 .../java/org/apache/commons/io/comparator/NameFileComparator.java   | 6 +++---
 .../java/org/apache/commons/io/comparator/PathFileComparator.java   | 6 +++---
 .../{ReverseComparator.java => ReverseFileComparator.java}          | 4 ++--
 .../java/org/apache/commons/io/comparator/SizeFileComparator.java   | 4 ++--
 .../apache/commons/io/comparator/ComparatorAbstractTestCase.java    | 2 +-
 .../apache/commons/io/comparator/CompositeFileComparatorTest.java   | 2 +-
 10 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/comparator/DefaultFileComparator.java b/src/main/java/org/apache/commons/io/comparator/DefaultFileComparator.java
index afaa785..7f54c30 100644
--- a/src/main/java/org/apache/commons/io/comparator/DefaultFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/DefaultFileComparator.java
@@ -51,7 +51,7 @@ public class DefaultFileComparator extends AbstractFileComparator implements
Ser
     public static final Comparator<File> DEFAULT_COMPARATOR = new DefaultFileComparator();
 
     /** Singleton reverse default comparator instance */
-    public static final Comparator<File> DEFAULT_REVERSE = new ReverseComparator(DEFAULT_COMPARATOR);
+    public static final Comparator<File> DEFAULT_REVERSE = new ReverseFileComparator(DEFAULT_COMPARATOR);
 
     /**
      * Compare the two files using the {@link File#compareTo(File)} method.
diff --git a/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java b/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
index c340191..fc79432 100644
--- a/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
@@ -54,7 +54,7 @@ public class DirectoryFileComparator extends AbstractFileComparator implements
S
     public static final Comparator<File> DIRECTORY_COMPARATOR = new DirectoryFileComparator();
 
     /** Singleton reverse default comparator instance */
-    public static final Comparator<File> DIRECTORY_REVERSE = new ReverseComparator(DIRECTORY_COMPARATOR);
+    public static final Comparator<File> DIRECTORY_REVERSE = new ReverseFileComparator(DIRECTORY_COMPARATOR);
 
     /**
      * Compare the two files using the {@link File#isDirectory()} method.
diff --git a/src/main/java/org/apache/commons/io/comparator/ExtensionFileComparator.java b/src/main/java/org/apache/commons/io/comparator/ExtensionFileComparator.java
index 176862f..f5503cd 100644
--- a/src/main/java/org/apache/commons/io/comparator/ExtensionFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/ExtensionFileComparator.java
@@ -58,7 +58,7 @@ public class ExtensionFileComparator extends AbstractFileComparator implements
S
     public static final Comparator<File> EXTENSION_COMPARATOR = new ExtensionFileComparator();
 
     /** Reverse case-sensitive extension comparator instance (see {@link IOCase#SENSITIVE})
*/
-    public static final Comparator<File> EXTENSION_REVERSE = new ReverseComparator(EXTENSION_COMPARATOR);
+    public static final Comparator<File> EXTENSION_REVERSE = new ReverseFileComparator(EXTENSION_COMPARATOR);
 
     /** Case-insensitive extension comparator instance (see {@link IOCase#INSENSITIVE}) */
     public static final Comparator<File> EXTENSION_INSENSITIVE_COMPARATOR
@@ -66,13 +66,13 @@ public class ExtensionFileComparator extends AbstractFileComparator implements
S
 
     /** Reverse case-insensitive extension comparator instance (see {@link IOCase#INSENSITIVE})
*/
     public static final Comparator<File> EXTENSION_INSENSITIVE_REVERSE
-                                                = new ReverseComparator(EXTENSION_INSENSITIVE_COMPARATOR);
+                                                = new ReverseFileComparator(EXTENSION_INSENSITIVE_COMPARATOR);
 
     /** System sensitive extension comparator instance (see {@link IOCase#SYSTEM}) */
     public static final Comparator<File> EXTENSION_SYSTEM_COMPARATOR = new ExtensionFileComparator(IOCase.SYSTEM);
 
     /** Reverse system sensitive path comparator instance (see {@link IOCase#SYSTEM}) */
-    public static final Comparator<File> EXTENSION_SYSTEM_REVERSE = new ReverseComparator(EXTENSION_SYSTEM_COMPARATOR);
+    public static final Comparator<File> EXTENSION_SYSTEM_REVERSE = new ReverseFileComparator(EXTENSION_SYSTEM_COMPARATOR);
 
     /** Whether the comparison is case sensitive. */
     private final IOCase caseSensitivity;
diff --git a/src/main/java/org/apache/commons/io/comparator/LastModifiedFileComparator.java
b/src/main/java/org/apache/commons/io/comparator/LastModifiedFileComparator.java
index cc57abf..9e7a73a 100644
--- a/src/main/java/org/apache/commons/io/comparator/LastModifiedFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/LastModifiedFileComparator.java
@@ -52,7 +52,7 @@ public class LastModifiedFileComparator extends AbstractFileComparator implement
     public static final Comparator<File> LASTMODIFIED_COMPARATOR = new LastModifiedFileComparator();
 
     /** Reverse last modified comparator instance */
-    public static final Comparator<File> LASTMODIFIED_REVERSE = new ReverseComparator(LASTMODIFIED_COMPARATOR);
+    public static final Comparator<File> LASTMODIFIED_REVERSE = new ReverseFileComparator(LASTMODIFIED_COMPARATOR);
 
     /**
      * Compare the last the last modified date/time of two files.
diff --git a/src/main/java/org/apache/commons/io/comparator/NameFileComparator.java b/src/main/java/org/apache/commons/io/comparator/NameFileComparator.java
index c4c6364..f5731ca 100644
--- a/src/main/java/org/apache/commons/io/comparator/NameFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/NameFileComparator.java
@@ -56,19 +56,19 @@ public class NameFileComparator extends AbstractFileComparator implements
Serial
     public static final Comparator<File> NAME_COMPARATOR = new NameFileComparator();
 
     /** Reverse case-sensitive name comparator instance (see {@link IOCase#SENSITIVE}) */
-    public static final Comparator<File> NAME_REVERSE = new ReverseComparator(NAME_COMPARATOR);
+    public static final Comparator<File> NAME_REVERSE = new ReverseFileComparator(NAME_COMPARATOR);
 
     /** Case-insensitive name comparator instance (see {@link IOCase#INSENSITIVE}) */
     public static final Comparator<File> NAME_INSENSITIVE_COMPARATOR = new NameFileComparator(IOCase.INSENSITIVE);
 
     /** Reverse case-insensitive name comparator instance (see {@link IOCase#INSENSITIVE})
*/
-    public static final Comparator<File> NAME_INSENSITIVE_REVERSE = new ReverseComparator(NAME_INSENSITIVE_COMPARATOR);
+    public static final Comparator<File> NAME_INSENSITIVE_REVERSE = new ReverseFileComparator(NAME_INSENSITIVE_COMPARATOR);
 
     /** System sensitive name comparator instance (see {@link IOCase#SYSTEM}) */
     public static final Comparator<File> NAME_SYSTEM_COMPARATOR = new NameFileComparator(IOCase.SYSTEM);
 
     /** Reverse system sensitive name comparator instance (see {@link IOCase#SYSTEM}) */
-    public static final Comparator<File> NAME_SYSTEM_REVERSE = new ReverseComparator(NAME_SYSTEM_COMPARATOR);
+    public static final Comparator<File> NAME_SYSTEM_REVERSE = new ReverseFileComparator(NAME_SYSTEM_COMPARATOR);
 
     /** Whether the comparison is case sensitive. */
     private final IOCase caseSensitivity;
diff --git a/src/main/java/org/apache/commons/io/comparator/PathFileComparator.java b/src/main/java/org/apache/commons/io/comparator/PathFileComparator.java
index 6207e3a..a02a29d 100644
--- a/src/main/java/org/apache/commons/io/comparator/PathFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/PathFileComparator.java
@@ -56,19 +56,19 @@ public class PathFileComparator extends AbstractFileComparator implements
Serial
     public static final Comparator<File> PATH_COMPARATOR = new PathFileComparator();
 
     /** Reverse case-sensitive path comparator instance (see {@link IOCase#SENSITIVE}) */
-    public static final Comparator<File> PATH_REVERSE = new ReverseComparator(PATH_COMPARATOR);
+    public static final Comparator<File> PATH_REVERSE = new ReverseFileComparator(PATH_COMPARATOR);
 
     /** Case-insensitive path comparator instance (see {@link IOCase#INSENSITIVE}) */
     public static final Comparator<File> PATH_INSENSITIVE_COMPARATOR = new PathFileComparator(IOCase.INSENSITIVE);
 
     /** Reverse case-insensitive path comparator instance (see {@link IOCase#INSENSITIVE})
*/
-    public static final Comparator<File> PATH_INSENSITIVE_REVERSE = new ReverseComparator(PATH_INSENSITIVE_COMPARATOR);
+    public static final Comparator<File> PATH_INSENSITIVE_REVERSE = new ReverseFileComparator(PATH_INSENSITIVE_COMPARATOR);
 
     /** System sensitive path comparator instance (see {@link IOCase#SYSTEM}) */
     public static final Comparator<File> PATH_SYSTEM_COMPARATOR = new PathFileComparator(IOCase.SYSTEM);
 
     /** Reverse system sensitive path comparator instance (see {@link IOCase#SYSTEM}) */
-    public static final Comparator<File> PATH_SYSTEM_REVERSE = new ReverseComparator(PATH_SYSTEM_COMPARATOR);
+    public static final Comparator<File> PATH_SYSTEM_REVERSE = new ReverseFileComparator(PATH_SYSTEM_COMPARATOR);
 
     /** Whether the comparison is case sensitive. */
     private final IOCase caseSensitivity;
diff --git a/src/main/java/org/apache/commons/io/comparator/ReverseComparator.java b/src/main/java/org/apache/commons/io/comparator/ReverseFileComparator.java
similarity index 93%
rename from src/main/java/org/apache/commons/io/comparator/ReverseComparator.java
rename to src/main/java/org/apache/commons/io/comparator/ReverseFileComparator.java
index 685bfe1..5d3925f 100644
--- a/src/main/java/org/apache/commons/io/comparator/ReverseComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/ReverseFileComparator.java
@@ -26,7 +26,7 @@ import java.util.Comparator;
  *
  * @since 1.4
  */
-class ReverseComparator extends AbstractFileComparator implements Serializable {
+class ReverseFileComparator extends AbstractFileComparator implements Serializable {
 
     private static final long serialVersionUID = -4808255005272229056L;
     private final Comparator<File> delegate;
@@ -36,7 +36,7 @@ class ReverseComparator extends AbstractFileComparator implements Serializable
{
      *
      * @param delegate The comparator to delegate to
      */
-    public ReverseComparator(final Comparator<File> delegate) {
+    public ReverseFileComparator(final Comparator<File> delegate) {
         if (delegate == null) {
             throw new IllegalArgumentException("Delegate comparator is missing");
         }
diff --git a/src/main/java/org/apache/commons/io/comparator/SizeFileComparator.java b/src/main/java/org/apache/commons/io/comparator/SizeFileComparator.java
index 34944b3..c6f3803 100644
--- a/src/main/java/org/apache/commons/io/comparator/SizeFileComparator.java
+++ b/src/main/java/org/apache/commons/io/comparator/SizeFileComparator.java
@@ -56,7 +56,7 @@ public class SizeFileComparator extends AbstractFileComparator implements
Serial
     public static final Comparator<File> SIZE_COMPARATOR = new SizeFileComparator();
 
     /** Reverse size comparator instance - directories are treated as zero size */
-    public static final Comparator<File> SIZE_REVERSE = new ReverseComparator(SIZE_COMPARATOR);
+    public static final Comparator<File> SIZE_REVERSE = new ReverseFileComparator(SIZE_COMPARATOR);
 
     /**
      * Size comparator instance which sums the size of a directory's contents
@@ -68,7 +68,7 @@ public class SizeFileComparator extends AbstractFileComparator implements
Serial
      * Reverse size comparator instance which sums the size of a directory's contents
      * using {@link FileUtils#sizeOfDirectory(File)}
      */
-    public static final Comparator<File> SIZE_SUMDIR_REVERSE = new ReverseComparator(SIZE_SUMDIR_COMPARATOR);
+    public static final Comparator<File> SIZE_SUMDIR_REVERSE = new ReverseFileComparator(SIZE_SUMDIR_COMPARATOR);
 
     /** Whether the sum of the directory's contents should be calculated. */
     private final boolean sumDirectoryContents;
diff --git a/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
b/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
index 131b451..5a1c3e8 100644
--- a/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
+++ b/src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
@@ -128,6 +128,6 @@ public abstract class ComparatorAbstractTestCase {
     @Test
     public void testToString() {
         assertNotNull(comparator.toString(), "comparator");
-        assertTrue(reverse.toString().startsWith("ReverseComparator["), "reverse");
+        assertTrue(reverse.toString().startsWith("ReverseFileComparator["), "reverse");
     }
 }
diff --git a/src/test/java/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
b/src/test/java/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
index df2bd40..66c61c7 100644
--- a/src/test/java/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
+++ b/src/test/java/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
@@ -42,7 +42,7 @@ public class CompositeFileComparatorTest extends ComparatorAbstractTestCase
{
                 new AbstractFileComparator[] {
                     (AbstractFileComparator) SizeFileComparator.SIZE_COMPARATOR,
                     (AbstractFileComparator) ExtensionFileComparator.EXTENSION_COMPARATOR});
-        reverse = new ReverseComparator(comparator);
+        reverse = new ReverseFileComparator(comparator);
         lessFile   = new File(dir, "xyz.txt");
         equalFile1 = new File(dir, "foo.txt");
         equalFile2 = new File(dir, "bar.txt");


Mime
View raw message