diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-20 17:01:23 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-08-20 17:01:23 -0700 |
commit | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (patch) | |
tree | 2f4cc6d69645bd460aa253fdecb606d764fbd25d /java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java | |
parent | 02cf98d65c798d368fcec43ed64a001d513bdd4f (diff) | |
download | idea-1aa2e09bdbd413eacb677e9fa4b50630530d0656.tar.gz |
Snapshot idea/138.1696 from git://git.jetbrains.org/idea/community.git
Change-Id: I50c97b83a815ce635e49a38380ba5b8765e4b16a
Diffstat (limited to 'java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java')
-rw-r--r-- | java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java | 17 |
1 files changed, 11 insertions, 6 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 f43358007eab..f05df7dab9c1 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 @@ -130,7 +130,6 @@ public class MethodCandidateInfo extends CandidateInfo{ final CurrentCandidateProperties properties = new CurrentCandidateProperties(method, substitutor, isVarargs(), true); final CurrentCandidateProperties alreadyThere = map.put(getMarkerList(), properties); try { - properties.setSubstitutor(substitutor); PsiType[] argumentTypes = getArgumentTypes(); if (argumentTypes == null) { return ApplicabilityLevel.NOT_APPLICABLE; @@ -143,7 +142,11 @@ public class MethodCandidateInfo extends CandidateInfo{ return applicabilityLevel; } finally { - if (alreadyThere == null) map.remove(getMarkerList()); + if (alreadyThere == null) { + map.remove(getMarkerList()); + } else { + map.put(getMarkerList(), alreadyThere); + } } } return getApplicabilityLevelInner(); @@ -269,10 +272,8 @@ public class MethodCandidateInfo extends CandidateInfo{ CURRENT_CANDIDATE.set(map); } final PsiMethod method = getElement(); - final CurrentCandidateProperties alreadyThere = map.get(getMarkerList()); - if (alreadyThere == null) { + final CurrentCandidateProperties alreadyThere = map.put(getMarkerList(), new CurrentCandidateProperties(method, super.getSubstitutor(), isVarargs(), !includeReturnConstraint)); - } try { PsiTypeParameter[] typeParameters = method.getTypeParameters(); @@ -293,7 +294,11 @@ public class MethodCandidateInfo extends CandidateInfo{ .inferTypeArguments(typeParameters, method.getParameterList().getParameters(), arguments, mySubstitutor, parent, policy, myLanguageLevel); } finally { - if (alreadyThere == null) map.remove(getMarkerList()); + if (alreadyThere == null) { + map.remove(getMarkerList()); + } else { + map.put(getMarkerList(), alreadyThere); + } } } |