mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 03:07:47 +07:00
BulkFileAttributesReadInspection: cr fixes (IJ-CR-20279):
1. analyze all calls in method in one go 2. use UncheckedIOException instead of RuntimeException when wrapping into try catch 3. info level when try catch needed + no report in batch mode 4. updated description GitOrigin-RevId: 0a2542b851fa32c5fde98725985f55079447b02b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a43c389c46
commit
bcca6ef32f
@@ -11,8 +11,8 @@ class Foo {
|
||||
try {
|
||||
BasicFileAttributes basicFileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);
|
||||
return basicFileAttributes.isDirectory() && basicFileAttributes.isRegularFile();
|
||||
throw new IOException("");
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ class Foo {
|
||||
try {
|
||||
basicFileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
while (basicFileAttributes.isDirectory()) {
|
||||
System.out.println(basicFileAttributes.isRegularFile());
|
||||
|
||||
@@ -8,8 +8,8 @@ class Foo {
|
||||
boolean printDirectory() {
|
||||
try {
|
||||
return file.isDirec<caret>tory() && file.isFile();
|
||||
throw new IOException("");
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user