inline some-single use variables.
Formatting nits.
MODIFY
src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java
src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java
@@ -181,8 +181,7 @@ public AgeFileFilter(final long cutoffMillis, final boolean acceptOlder) {
*/
@Override
public boolean accept(final File file) {
- final boolean newer = FileUtils.isFileNewer(file, cutoffInstant);
- return acceptOlder != newer;
+ return acceptOlder != FileUtils.isFileNewer(file, cutoffInstant);
}
/**
@@ -198,13 +197,11 @@ public boolean accept(final File file) {
*/
@Override
public FileVisitResult accept(final Path file, final BasicFileAttributes attributes) {
- final boolean newer;
try {
- newer = PathUtils.isNewer(file, cutoffInstant);
+ return toFileVisitResult(acceptOlder != PathUtils.isNewer(file, cutoffInstant));
} catch (final IOException e) {
return handle(e);
}
- return toFileVisitResult(acceptOlder != newer);
}
/**

MODIFY
src/main/java/org/apache/commons/io/filefilter/MagicNumberFileFilter.java
src/main/java/org/apache/commons/io/filefilter/MagicNumberFileFilter.java
@@ -235,8 +235,7 @@ public MagicNumberFileFilter(final String magicNumber, final long offset) {
throw new IllegalArgumentException("The offset cannot be negative");
}
- this.magicNumbers = magicNumber.getBytes(Charset.defaultCharset()); // explicitly uses the platform default
- // charset
+ this.magicNumbers = magicNumber.getBytes(Charset.defaultCharset()); // explicitly uses the platform default charset
this.byteOffset = offset;
}

MODIFY
src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
src/main/java/org/apache/commons/io/filefilter/NotFileFilter.java
@@ -84,8 +84,7 @@ public FileVisitResult accept(final Path file, final BasicFileAttributes attribu
}
private FileVisitResult not(final FileVisitResult accept) {
- return accept == FileVisitResult.CONTINUE ? FileVisitResult.TERMINATE
- : FileVisitResult.CONTINUE;
+ return accept == FileVisitResult.CONTINUE ? FileVisitResult.TERMINATE : FileVisitResult.CONTINUE;
}
/**

MODIFY
src/main/java/org/apache/commons/io/filefilter/PathVisitorFileFilter.java
src/main/java/org/apache/commons/io/filefilter/PathVisitorFileFilter.java
@@ -50,8 +50,7 @@ public PathVisitorFileFilter(final PathVisitor pathVisitor) {
public boolean accept(final File file) {
try {
final Path path = file.toPath();
- return visitFile(path,
- file.exists() ? PathUtils.readBasicFileAttributes(path) : null) == FileVisitResult.CONTINUE;
+ return visitFile(path, file.exists() ? PathUtils.readBasicFileAttributes(path) : null) == FileVisitResult.CONTINUE;
} catch (final IOException e) {
return handle(e) == FileVisitResult.CONTINUE;
}

inline some-single use variables.

Formatting nits.