TypeConversionUtil: rollback incorrect method extraction

This commit is contained in:
Tagir Valeev
2018-12-28 17:43:26 +07:00
parent d174ede815
commit 4b8db6b75f
@@ -1029,7 +1029,9 @@ public class TypeConversionUtil {
}
else { //isSuper
if (rightWildcard.isSuper() && bound != null) {
return checkAssignable(bound, leftBound, rightWildcard, allowUncheckedConversion);
NotNullComputable<Boolean> checkAssignable = () -> isAssignable(bound, leftBound, allowUncheckedConversion, false);
final Boolean assignable = ourGuard.doPreventingRecursion(rightWildcard, true, checkAssignable);
return assignable != null && assignable;
}
return false;
}
@@ -1039,7 +1041,9 @@ public class TypeConversionUtil {
return isAssignable(leftBound, typeRight, false, false);
}
else { // isSuper
return checkAssignable(typeRight, leftBound, leftWildcard, false);
NotNullComputable<Boolean> checkAssignable = () -> isAssignable(typeRight, leftBound, false, false);
final Boolean assignable = ourGuard.doPreventingRecursion(leftWildcard, true, checkAssignable);
return assignable == null || assignable.booleanValue();
}
}
}
@@ -1048,15 +1052,6 @@ public class TypeConversionUtil {
}
}
private static boolean checkAssignable(@NotNull PsiType left,
@NotNull PsiType right,
@NotNull PsiWildcardType context,
boolean allowUncheckedConversion) {
NotNullComputable<Boolean> isAssignable = () -> isAssignable(left, right, allowUncheckedConversion, false);
final Boolean assignable = ourGuard.doPreventingRecursion(context, true, isAssignable);
return assignable != null && assignable;
}
@Nullable
public static PsiSubstitutor getClassSubstitutor(@NotNull PsiClass superClassCandidate,
@NotNull PsiClass derivedClassCandidate,