mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
Inspection suggests conversions: 1. FileInputStream -> Files.newInputStream 2. FileOutputStream -> Files.newOutputStream in cases when FileInputStream can be replaced with InputStream. Also, it reuses path variable after conversion when possible (path variable should be effectively final). GitOrigin-RevId: 474dcaeeb5336fcc8330b4b3ed65d443042ecf2f
12 lines
268 B
Java
12 lines
268 B
Java
// "Replace with 'Files.newOutputStream'" "true"
|
|
import java.io.*;
|
|
import java.nio.file.Files;
|
|
|
|
class Foo {
|
|
void test(File file) {
|
|
try (OutputStream os = Files.newOutputStream(file.toPath())) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
} |