mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-29 16:07:54 +07:00
1. analyze all calls in method in one go 2. use UncheckedIOException instead of RuntimeException when wrapping into try catch 3. info level when try catch needed + no report in batch mode 4. updated description GitOrigin-RevId: 0a2542b851fa32c5fde98725985f55079447b02b
19 lines
644 B
Java
19 lines
644 B
Java
// "Replace with bulk 'Files.readAttributes' call" "true"
|
|
import java.io.*;
|
|
import java.nio.file.Files;
|
|
import java.nio.file.attribute.BasicFileAttributes;
|
|
|
|
class Foo {
|
|
long isNewFile(File file, long lastModified) {
|
|
BasicFileAttributes basicFileAttributes;
|
|
try {
|
|
basicFileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);
|
|
} catch (IOException e) {
|
|
throw new UncheckedIOException(e);
|
|
}
|
|
while (basicFileAttributes.isDirectory()) {
|
|
System.out.println(basicFileAttributes.isRegularFile());
|
|
}
|
|
return basicFileAttributes.lastModifiedTime().toMillis();
|
|
}
|
|
} |