From 962d829d51cca072093fac7ea379baf195b31daa Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Wed, 10 Dec 2014 14:00:08 +0100 Subject: [PATCH] IPP: don't offer to convert catch to throws if that would mean changing a library --- .../siyeh/ipp/exceptions/ConvertCatchToThrowsPredicate.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ConvertCatchToThrowsPredicate.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ConvertCatchToThrowsPredicate.java index 7e15549e10a1..2686a483c13c 100644 --- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ConvertCatchToThrowsPredicate.java +++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/exceptions/ConvertCatchToThrowsPredicate.java @@ -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; } }