mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-analysis] Minor fix+javadoc for type nullability support (IDEA-372347)
GitOrigin-RevId: c35b63418dc3973e0b0f27f63f79fe465ae1b676
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5ebcadc7eb
commit
6c7bdfdace
@@ -65,6 +65,11 @@ public final class TypeNullability {
|
||||
return inherited.equals(mySource) ? this : new TypeNullability(myNullability, inherited);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nullability instantiation nullability
|
||||
* @return the nullability of the instantiated type parameter,
|
||||
* assuming that this object is the declared nullability of the type parameter.
|
||||
*/
|
||||
public @NotNull TypeNullability instantiatedWith(@NotNull TypeNullability nullability) {
|
||||
if (this.nullability() == nullability.nullability()) {
|
||||
return intersect(Arrays.asList(this, nullability));
|
||||
|
||||
@@ -82,7 +82,7 @@ public final class JavaTypeNullabilityUtil {
|
||||
for (PsiAnnotation annotation : annotations) {
|
||||
String qualifiedName = annotation.getQualifiedName();
|
||||
NullableNotNullManager manager = NullableNotNullManager.getInstance(annotation.getProject());
|
||||
if (manager == null) continue;
|
||||
if (manager == null) return TypeNullability.UNKNOWN;
|
||||
Optional<Nullability> optionalNullability = manager.getAnnotationNullability(qualifiedName);
|
||||
if (optionalNullability.isPresent()) {
|
||||
Nullability nullability = optionalNullability.get();
|
||||
|
||||
Reference in New Issue
Block a user