Rename internal class from ReverseComparator to ReverseFileComparator.
MODIFY
src/main/java/org/apache/commons/io/comparator/DefaultFileComparator.java
src/main/java/org/apache/commons/io/comparator/DefaultFileComparator.java
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.

MODIFY
src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
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.

MODIFY
src/main/java/org/apache/commons/io/comparator/ExtensionFileComparator.java
src/main/java/org/apache/commons/io/comparator/ExtensionFileComparator.java
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
/** 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;

MODIFY
src/main/java/org/apache/commons/io/comparator/LastModifiedFileComparator.java
src/main/java/org/apache/commons/io/comparator/LastModifiedFileComparator.java
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.

MODIFY
src/main/java/org/apache/commons/io/comparator/NameFileComparator.java
src/main/java/org/apache/commons/io/comparator/NameFileComparator.java
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;

MODIFY
src/main/java/org/apache/commons/io/comparator/PathFileComparator.java
src/main/java/org/apache/commons/io/comparator/PathFileComparator.java
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;

RENAME
src/main/java/org/apache/commons/io/comparator/ReverseComparator.java
src/main/java/org/apache/commons/io/comparator/ReverseFileComparator.java
*
* @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;
*
* @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");
}

MODIFY
src/main/java/org/apache/commons/io/comparator/SizeFileComparator.java
src/main/java/org/apache/commons/io/comparator/SizeFileComparator.java
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
* 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;

MODIFY
src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
src/test/java/org/apache/commons/io/comparator/ComparatorAbstractTestCase.java
@@ -128,6 +128,6 @@ public void testSortListNull() {
@Test
public void testToString() {
assertNotNull(comparator.toString(), "comparator");
- assertTrue(reverse.toString().startsWith("ReverseComparator["), "reverse");
+ assertTrue(reverse.toString().startsWith("ReverseFileComparator["), "reverse");
}
}

MODIFY
src/test/java/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
src/test/java/org/apache/commons/io/comparator/CompositeFileComparatorTest.java
@@ -42,7 +42,7 @@ public void setUp() throws Exception {
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");

Rename internal class from ReverseComparator to ReverseFileComparator.