mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-29 18:17:08 +07:00
PR#2508 Reviewed-by: Tagir Valeev <tagir.valeev@jetbrains.com> GitOrigin-RevId: c3914e71028831bcd72121e0f3070d4ed1fc01db
18 lines
1.2 KiB
Java
18 lines
1.2 KiB
Java
import java.io.*;
|
|
|
|
public class Simple {
|
|
public long modificationTime(File file) {
|
|
if (<info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.isDirectory()</info>) {
|
|
System.out.println(<info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.isFile()</info>);
|
|
}
|
|
return <info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.lastModified()</info>;
|
|
}
|
|
public long isAlwaysDirectory(File file) {
|
|
System.out.println(<info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.isFile()</info>);
|
|
while (file.isDirectory()) {
|
|
System.out.println(<info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.isFile()</info>);
|
|
System.out.println(<info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.length()</info>);
|
|
}
|
|
return <info descr="Multiple file attribute calls can be replaced with single 'Files.readAttributes()' call">file.lastModified()</info>;
|
|
}
|
|
} |