mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 11:36:59 +07:00
Inspection reports multiple java.io.File attribute calls in a row. Attribute calls: - lastModified - isFile - isDirectory - length It suggests replacing them with a single attributes extraction using java.nio.file.Files.readAttributes method GitOrigin-RevId: cd2f93645aab9a4cba2e1f87e05b431f0d21ee50
12 lines
291 B
Java
12 lines
291 B
Java
// "Replace with bulk 'Files.readAttributes' call" "false"
|
|
import java.io.*;
|
|
|
|
class Foo {
|
|
long isNewFile(File file, long lastModified) {
|
|
while (file.isDir<caret>ectory()) {
|
|
System.out.println(file.isFile());
|
|
}
|
|
file = new File("foo");
|
|
return file.lastModified();
|
|
}
|
|
} |