Use Java 8 APIs
MODIFY
src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
@@ -343,9 +343,7 @@ private void doDelete(final FileEntry entry) {
private FileEntry[] doListFiles(final File file, final FileEntry entry) {
final File[] files = listFiles(file);
final FileEntry[] children = files.length > 0 ? new FileEntry[files.length] : FileEntry.EMPTY_FILE_ENTRY_ARRAY;
- for (int i = 0; i < files.length; i++) {
- children[i] = createFileEntry(entry, files[i]);
- }
+ Arrays.setAll(children, i -> createFileEntry(entry, files[i]));
return children;
}

Use Java 8 APIs