From 8d22bd8af543ddcc4f8a1417cd238e7b79bb279e Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 29 Nov 2013 18:16:48 +0100 Subject: [PATCH] EA-52505 - NPE: MethodCandidateInfo.getPertinentApplicabilityLevel --- .../src/com/intellij/psi/infos/MethodCandidateInfo.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java b/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java index c6a8d713e1c2..0851f2640bc6 100644 --- a/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java +++ b/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java @@ -111,22 +111,24 @@ public class MethodCandidateInfo extends CandidateInfo{ } else { final PsiSubstitutor substitutor = getSubstitutor(); - level = ourOverloadGuard.doPreventingRecursion(myArgumentList, false, new Computable() { + Integer boxedLevel = ourOverloadGuard.doPreventingRecursion(myArgumentList, false, new Computable() { @Override public Integer compute() { return PsiUtil.getApplicabilityLevel(getElement(), substitutor, myArgumentTypes, myLanguageLevel); } }); + level = boxedLevel != null ? boxedLevel : getApplicabilityLevel(); } if (level > ApplicabilityLevel.NOT_APPLICABLE && !isTypeArgumentsApplicable()) level = ApplicabilityLevel.NOT_APPLICABLE; return level; } - return ourOverloadGuard.doPreventingRecursion(myArgumentList, false, new Computable() { + Integer boxedLevel = ourOverloadGuard.doPreventingRecursion(myArgumentList, false, new Computable() { @Override public Integer compute() { return getApplicabilityLevelInner(); } }); + return boxedLevel != null ? boxedLevel : getApplicabilityLevel(); } public PsiSubstitutor getSiteSubstitutor() {