mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +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
268 B
Java
12 lines
268 B
Java
// "Replace with bulk 'Files.readAttributes' call" "true"
|
|
import java.io.*;
|
|
|
|
class Foo {
|
|
boolean printDirectory(File file) {
|
|
try {
|
|
return file.isDirec<caret>tory() && file.isFile();
|
|
throw new IOException("");
|
|
} catch (IOException e) {
|
|
}
|
|
}
|
|
} |