Use java8 reference
MODIFY
src/main/java/org/apache/commons/io/FileUtils.java
src/main/java/org/apache/commons/io/FileUtils.java
@@ -341,7 +341,7 @@ public static long checksumCRC32(final File file) throws IOException {
* @see #forceDelete(File)
*/
public static void cleanDirectory(final File directory) throws IOException {
- IOConsumer.forEach(listFiles(directory, null), file -> forceDelete(file));
+ IOConsumer.forEach(listFiles(directory, null), FileUtils::forceDelete);
}
/**
@@ -354,7 +354,7 @@ public static void cleanDirectory(final File directory) throws IOException {
* @see #forceDeleteOnExit(File)
*/
private static void cleanDirectoryOnExit(final File directory) throws IOException {
- IOConsumer.forEach(listFiles(directory, null), file -> forceDeleteOnExit(file));
+ IOConsumer.forEach(listFiles(directory, null), FileUtils::forceDeleteOnExit);
}
/**

MODIFY
src/main/java/org/apache/commons/io/output/FilterCollectionWriter.java
src/main/java/org/apache/commons/io/output/FilterCollectionWriter.java
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Objects;
import java.util.function.Predicate;
import java.util.stream.Stream;
public class FilterCollectionWriter extends Writer {
@SuppressWarnings("rawtypes")
- private static final Predicate NOT_NULL = e -> e != null;
+ private static final Predicate NOT_NULL = Objects::nonNull;
@SuppressWarnings("unchecked")
private static <T> Predicate<T> notNull() {

Use java8 reference (#321)