mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 04:09:09 +07:00
1. report for arbitrary expressions that expect OutputStream / InputStream 2. report for arbitrary file creation arguments 3. check recursively if file creation argument is effectively final 4. reuse effectively final path variables if possible 5. use Paths.get() instead of Path.of() since 'of' method appeared only in java 11 6. info level for java 10 and higher GitOrigin-RevId: 0a778328fe938faa0fe7eb2f199064f90b7a6d1b
15 lines
431 B
Java
15 lines
431 B
Java
// "Replace with 'Files.newInputStream'" "true"
|
|
import java.io.*;
|
|
import java.nio.file.Files;
|
|
import java.nio.file.Paths;
|
|
|
|
class Foo {
|
|
void test(String path, boolean b, boolean b1) {
|
|
Path name = Paths.get(b ? b1 ? "foo" : path : "baz");
|
|
path = "bar";
|
|
try (InputStream is = Files.newInputStream(Paths.get(b ? b1 ? "foo" : path : "baz"))) {
|
|
} catch (IOException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
} |