diff options
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); + } } } |