mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IPP: don't offer to convert catch to throws if that would mean changing a library
This commit is contained in:
+5
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user