reject caching during resolve only inside lambda body (IDEA-138511)
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Tue, 31 Mar 2015 11:39:55 +0000 (13:39 +0200)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Tue, 31 Mar 2015 11:48:28 +0000 (13:48 +0200)
java/java-psi-api/src/com/intellij/psi/LambdaUtil.java
java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java

index 954dd08703c9867f2ec0c688f1a36a5fb889779c..9d4cf552c4fe40c94d19abe402ff65ee4a752b52 100644 (file)
@@ -340,6 +340,9 @@ public class LambdaUtil {
         if (gParent instanceof PsiCall) {
           final PsiCall contextCall = (PsiCall)gParent;
           final MethodCandidateInfo.CurrentCandidateProperties properties = MethodCandidateInfo.getCurrentMethod(contextCall.getArgumentList());
+          if (MethodCandidateInfo.isOverloadCheck()) {
+            MethodCandidateInfo.ourOverloadGuard.prohibitResultCaching(MethodCandidateInfo.ourOverloadGuard.currentStack().get(0));
+          }
           if (properties != null && properties.isApplicabilityCheck()) { //todo simplification
             final PsiParameter[] parameters = properties.getMethod().getParameterList().getParameters();
             final int finalLambdaIdx = adjustLambdaIdx(lambdaIdx, properties.getMethod(), parameters);
index 78a58fc8b70bd91d17eb194177ba401f5dfbafd1..7a87a8c6bb493e2a5a701616a4e68a8030a22f4f 100644 (file)
@@ -326,9 +326,6 @@ public class MethodCandidateInfo extends CandidateInfo{
 
 
   public static CurrentCandidateProperties getCurrentMethod(PsiElement context) {
-    if (isOverloadCheck()) {
-      ourOverloadGuard.prohibitResultCaching(ourOverloadGuard.currentStack().get(0));
-    }
     final Map<PsiElement, CurrentCandidateProperties> currentMethodCandidates = CURRENT_CANDIDATE.get();
     return currentMethodCandidates != null ? currentMethodCandidates.get(context) : null;
   }