mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
redundant exception: ignore recursive calls (IDEA-157773)
This commit is contained in:
@@ -97,7 +97,7 @@ public class RedundantThrowsDeclaration extends BaseJavaBatchLocalInspectionTool
|
||||
return null;
|
||||
}
|
||||
|
||||
Collection<PsiClassType> types = ExceptionUtil.collectUnhandledExceptions(body, method);
|
||||
Collection<PsiClassType> types = ExceptionUtil.collectUnhandledExceptions(body, method, false);
|
||||
Collection<PsiClassType> unhandled = new HashSet<PsiClassType>(types);
|
||||
if (method.isConstructor()) {
|
||||
// there may be field initializer throwing exception
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Remove 'java.io.IOException' from 'f' throws list" "true"
|
||||
import java.io.*;
|
||||
|
||||
class a {
|
||||
private void f() <caret>{
|
||||
if (false) f();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Remove 'java.io.IOException' from 'f' throws list" "true"
|
||||
import java.io.*;
|
||||
|
||||
class a {
|
||||
private void f() throws <caret>IOException {
|
||||
if (false) f();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user