redundant exception: ignore recursive calls (IDEA-157773)

This commit is contained in:
Anna Kozlova
2016-06-22 17:08:09 +03:00
parent dd61f64dcc
commit 4f45f25c38
3 changed files with 19 additions and 1 deletions

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -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();
}
}