diff --git a/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java index e2d305c8fdd..087bc684d6d 100644 --- a/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java +++ b/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java @@ -100,7 +100,7 @@ public boolean accept(final File dir, final String name) { */ @Override public String toString() { - final String delegate = fileFilter != null ? fileFilter.toString() : fileNameFilter.toString(); + final String delegate = Objects.toString(fileFilter, fileNameFilter.toString()); return super.toString() + "(" + delegate + ")"; }