From ca7f62e99408d5764fbc12544b333c4cd5fab345 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 9 Oct 2015 14:56:37 +0200 Subject: [PATCH] method refs: don't collect method thrown types if asked outside functional interface check --- .../src/com/intellij/codeInsight/ExceptionUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java index 0b6398ec9a8f..92fe13866aac 100644 --- a/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java +++ b/java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java @@ -266,7 +266,9 @@ public class ExceptionUtil { unhandledExceptions = getUnhandledExceptions(expression, topElement, includeSelfCalls); } else if (element instanceof PsiMethodReferenceExpression) { - unhandledExceptions = getUnhandledExceptions((PsiMethodReferenceExpression)element, topElement); + PsiExpression qualifierExpression = ((PsiMethodReferenceExpression)element).getQualifierExpression(); + return qualifierExpression != null ? collectUnhandledExceptions(qualifierExpression, topElement, null, false) + : Collections.emptySet(); } else if (element instanceof PsiLambdaExpression) { return Collections.emptySet();