IPP: don't offer to convert catch to throws if that would mean changing a library

This commit is contained in:
Bas Leijdekkers
2014-12-10 14:00:36 +01:00
parent f7916ef70a
commit 962d829d51
@@ -30,6 +30,10 @@ class ConvertCatchToThrowsPredicate implements PsiElementPredicate {
return false;
}
final PsiElement owner = PsiTreeUtil.getParentOfType(parent, PsiMethod.class, PsiClass.class, PsiLambdaExpression.class);
return owner instanceof PsiMethod || owner instanceof PsiLambdaExpression;
if (owner instanceof PsiLambdaExpression) {
final PsiMethod method = LambdaUtil.getFunctionalInterfaceMethod(owner);
return !(method instanceof PsiCompiledElement);
}
return owner instanceof PsiMethod;
}
}