Revert reporting of nullableReturns in NULLABLE methods

Fixes IDEA-232076 false positive "@Nullable method 'getLeastUpperBound' always returns a non-null value" for com.intellij.psi.GenericsUtil#getLeastUpperBound(com.intellij.psi.PsiType, com.intellij.psi.PsiType, com.intellij.psi.PsiManager)

GitOrigin-RevId: 5dbe43b56af2fc7ef1edb69a05a296db4af0b34b
This commit is contained in:
Tagir Valeev
2020-02-04 18:08:39 +07:00
committed by intellij-monorepo-bot
parent 9c4086f6e6
commit a97a32a336
2 changed files with 9 additions and 7 deletions

View File

@@ -179,7 +179,7 @@ public class NullabilityProblemKind<T extends PsiElement> {
else if (parent instanceof PsiReturnStatement) {
targetType = PsiTypesUtil.getMethodReturnType(parent);
}
if (targetType != null && !PsiType.VOID.equals(targetType) && DfaPsiUtil.getTypeNullability(targetType) != Nullability.NULLABLE) {
if (targetType != null && !PsiType.VOID.equals(targetType)) {
if (TypeConversionUtil.isPrimitiveAndNotNull(targetType)) {
return createUnboxingProblem(context, expression);
}