mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 20:07:01 +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
11 lines
262 B
Java
11 lines
262 B
Java
// "Replace with bulk 'Files.readAttributes' call" "true"
|
|
import java.io.*;
|
|
|
|
class Foo {
|
|
long isNewFile(File file) throws IOException {
|
|
while (file.isDire<caret>ctory()) {
|
|
System.out.println(file.isFile());
|
|
}
|
|
return file.lastModified();
|
|
}
|
|
} |