Fix isNullableType() to always consider flexible types, even if they contain type parameters

This commit is contained in:
Andrey Breslav
2014-09-02 18:19:28 +04:00
parent 107480657a
commit 1dbfe5483a
4 changed files with 39 additions and 8 deletions
@@ -424,12 +424,12 @@ public class TypeUtils {
if (type.isNullable()) {
return true;
}
if (type.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
return hasNullableSuperType(type);
}
if (TypesPackage.isFlexible(type) && isNullableType(((FlexibleType) type).getUpperBound())) {
return true;
}
if (type.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
return hasNullableSuperType(type);
}
return false;
}