You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/11/27 14:31:29 UTC
[commons-vfs] 02/04: Add FalseFileFilter.INSTANCE and deprecate FalseFileFilter.FALSE.
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-vfs.git
commit 20cf3aeb72bcbb5250ce4943e85981d52f1bbcb6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 27 09:28:43 2021 -0500
Add FalseFileFilter.INSTANCE and deprecate FalseFileFilter.FALSE.
---
.../java/org/apache/commons/vfs2/filter/FalseFileFilter.java | 11 ++++++++++-
.../org/apache/commons/vfs2/filter/NotFileFilterTest.java | 1 +
src/changes/changes.xml | 3 +++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java
index 73e5440..c251af5 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java
@@ -34,8 +34,17 @@ public class FalseFileFilter implements FileFilter, Serializable {
/**
* Singleton instance of false filter.
+ *
+ * @since 2.10.0
+ */
+ public static final FileFilter INSTANCE = new FalseFileFilter();
+
+ /**
+ * Singleton instance of false filter.
+ * @deprecated Use {@link #INSTANCE}.
*/
- public static final FileFilter FALSE = new FalseFileFilter();
+ @Deprecated
+ public static final FileFilter FALSE = INSTANCE;
/**
* Restrictive constructor.
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/NotFileFilterTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/NotFileFilterTest.java
index 798758e..89f658b 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/NotFileFilterTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/NotFileFilterTest.java
@@ -35,6 +35,7 @@ public class NotFileFilterTest extends BaseFilterTest {
final FileSelectInfo any = createFileSelectInfo(new File("test1.txt"));
Assert.assertFalse(new NotFileFilter(TrueFileFilter.TRUE).accept(any));
+ Assert.assertTrue(new NotFileFilter(FalseFileFilter.INSTANCE).accept(any));
Assert.assertTrue(new NotFileFilter(FalseFileFilter.FALSE).accept(any));
}
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 78f0a21..25b87c0 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -81,6 +81,9 @@ The <action> type attribute can be add,update,fix,remove.
<action type="add" dev="ggregory" due-to="Gary Gregory">
DefaultFileMonitor implements AutoCloseable.
</action>
+ <action type="add" dev="ggregory" due-to="Gary Gregory">
+ Add FalseFileFilter.INSTANCE and deprecate FalseFileFilter.FALSE.
+ </action>
<!-- UDPATE -->
<action type="update" dev="ggregory" due-to="Dependabot">
Bump jakarta.mail from 1.6.7 to 2.0.1 #200.