summaryrefslogtreecommitdiff
path: root/java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-08-19 22:27:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-08-19 21:25:05 +0000
commit4ca751c002784c4bfd349cc5240b045b62277c80 (patch)
treedfc17b31990e2429535609b85f6d080c4fa0d9fe /java/java-psi-api/src/com/intellij/psi/infos/MethodCandidateInfo.java
parent890d9a2952301682ffecaed4495f5f65c84c3642 (diff)
parent060e58b3afea3ea39f5ba1cb5a443ca3ebda28c8 (diff)
downloadidea-4ca751c002784c4bfd349cc5240b045b62277c80.tar.gz
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
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.java8
1 files changed, 6 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 e7506ebd92fd..f43358007eab 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
@@ -180,7 +180,7 @@ public class MethodCandidateInfo extends CandidateInfo{
@NotNull
public PsiSubstitutor getSubstitutor(boolean includeReturnConstraint) {
PsiSubstitutor substitutor = myCalcedSubstitutor;
- if (substitutor == null || !includeReturnConstraint && myLanguageLevel.isAtLeast(LanguageLevel.JDK_1_8)) {
+ if (substitutor == null || !includeReturnConstraint && myLanguageLevel.isAtLeast(LanguageLevel.JDK_1_8) || isOverloadCheck()) {
PsiSubstitutor incompleteSubstitutor = super.getSubstitutor();
PsiMethod method = getElement();
if (myTypeArguments == null) {
@@ -189,7 +189,7 @@ public class MethodCandidateInfo extends CandidateInfo{
final PsiSubstitutor inferredSubstitutor = inferTypeArguments(DefaultParameterTypeInferencePolicy.INSTANCE, includeReturnConstraint);
if (!stackStamp.mayCacheNow() ||
- !ourOverloadGuard.currentStack().isEmpty() ||
+ isOverloadCheck() ||
!includeReturnConstraint && myLanguageLevel.isAtLeast(LanguageLevel.JDK_1_8) ||
getMarkerList() != null && PsiResolveHelper.ourGraphGuard.currentStack().contains(getMarkerList().getParent())) {
return inferredSubstitutor;
@@ -209,6 +209,10 @@ public class MethodCandidateInfo extends CandidateInfo{
return substitutor;
}
+ public static boolean isOverloadCheck() {
+ return !ourOverloadGuard.currentStack().isEmpty();
+ }
+
public boolean isTypeArgumentsApplicable() {
return isTypeArgumentsApplicable(false);