diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java index 91225ac7cded..9766122e31d0 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceIncorporationPhase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.intellij.psi.impl.source.resolve.graphInference; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.util.Couple; import com.intellij.openapi.util.Pair; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.graphInference.constraints.ConstraintFormula; @@ -306,9 +305,9 @@ public class InferenceIncorporationPhase { * then for all i, 1 ≤ i ≤ n, if Si and Ti are types (not wildcards), the constraint ⟨Si = Ti⟩ is implied. */ private boolean upUp(List upperBounds) { - return findParameterizationOfTheSameGenericClass(upperBounds, new Processor>() { + return findParameterizationOfTheSameGenericClass(upperBounds, new Processor>() { @Override - public boolean process(Couple pair) { + public boolean process(Pair pair) { final PsiType sType = pair.first; final PsiType tType = pair.second; if (!mySession.isProperType(sType) && !mySession.isProperType(tType)) { @@ -321,7 +320,7 @@ public class InferenceIncorporationPhase { }); } - public static boolean findParameterizationOfTheSameGenericClass(List upperBounds, Processor> processor) { + public static boolean findParameterizationOfTheSameGenericClass(List upperBounds, Processor> processor) { for (int i = 0; i < upperBounds.size(); i++) { final PsiType sBound = upperBounds.get(i); final PsiClass sClass = PsiUtil.resolveClassInClassTypeOnly(sBound); @@ -343,7 +342,7 @@ public class InferenceIncorporationPhase { for (PsiTypeParameter typeParameter : gClass.getTypeParameters()) { final PsiType sType = sSubstitutor.substitute(typeParameter); final PsiType tType = tSubstitutor.substitute(typeParameter); - if (!processor.process(Couple.newOne(sType, tType))) { + if (!processor.process(Pair.create(sType, tType))) { return true; } } diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java index f83c4fef9c18..f16231ac8d26 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ package com.intellij.psi.impl.source.resolve.graphInference; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Computable; -import com.intellij.openapi.util.Couple; import com.intellij.openapi.util.Key; +import com.intellij.openapi.util.Pair; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.graphInference.constraints.*; import com.intellij.psi.infos.MethodCandidateInfo; @@ -476,9 +476,9 @@ public class InferenceSession { private static boolean hasWildcardParameterization(InferenceVariable inferenceVariable, PsiClassType targetType) { if (!FunctionalInterfaceParameterizationUtil.isWildcardParameterized(targetType)) { final List bounds = inferenceVariable.getBounds(InferenceBound.LOWER); - final Processor> differentParameterizationProcessor = new Processor>() { + final Processor> differentParameterizationProcessor = new Processor>() { @Override - public boolean process(Couple pair) { + public boolean process(Pair pair) { return pair.first == null || pair.second == null || pair.first.equals(pair.second); } }; @@ -723,9 +723,9 @@ public class InferenceSession { } private PsiType getLowerBound(InferenceVariable var, PsiSubstitutor substitutor) { - return composeBound(var, InferenceBound.LOWER, new Function, PsiType>() { + return composeBound(var, InferenceBound.LOWER, new Function, PsiType>() { @Override - public PsiType fun(Couple pair) { + public PsiType fun(Pair pair) { return GenericsUtil.getLeastUpperBound(pair.first, pair.second, myManager); } }, substitutor); @@ -755,18 +755,18 @@ public class InferenceSession { } private PsiType getUpperBound(InferenceVariable var, PsiSubstitutor substitutor) { - return composeBound(var, InferenceBound.UPPER, new Function, PsiType>() { + return composeBound(var, InferenceBound.UPPER, new Function, PsiType>() { @Override - public PsiType fun(Couple pair) { + public PsiType fun(Pair pair) { return GenericsUtil.getGreatestLowerBound(pair.first, pair.second); } }, substitutor); } public PsiType getEqualsBound(InferenceVariable var, PsiSubstitutor substitutor) { - return composeBound(var, InferenceBound.EQ, new Function, PsiType>() { + return composeBound(var, InferenceBound.EQ, new Function, PsiType>() { @Override - public PsiType fun(Couple pair) { + public PsiType fun(Pair pair) { return pair.first; //todo check if equals } }, substitutor); @@ -774,7 +774,7 @@ public class InferenceSession { private PsiType composeBound(InferenceVariable variable, InferenceBound boundType, - Function, PsiType> fun, + Function, PsiType> fun, PsiSubstitutor substitutor) { final List lowerBounds = variable.getBounds(boundType); PsiType lub = PsiType.NULL; @@ -789,7 +789,7 @@ public class InferenceSession { lub = lowerBound; } else { - lub = fun.fun(Couple.newOne(lub, lowerBound)); + lub = fun.fun(Pair.create(lub, lowerBound)); } } }