[java-analysis] IDEA-375799 Container nullability annotation on the method has no effect on method return type

(cherry picked from commit f7cead47f32b2befeabe116a6c2df87682cb1cd2)

IJ-CR-169010

GitOrigin-RevId: 036988a6259830532f2174c60c39996d71efe819
This commit is contained in:
Tagir Valeev
2025-07-11 12:19:15 +02:00
committed by intellij-monorepo-bot
parent 830a094ed8
commit a0fec72e48
4 changed files with 29 additions and 2 deletions

View File

@@ -350,7 +350,7 @@ public abstract class NullableNotNullManager {
private @Nullable NullabilityAnnotationInfo findNullabilityDefault(@NotNull PsiElement place,
@NotNull PsiAnnotation.TargetType @NotNull ... placeTargetTypes) {
PsiElement element = place.getContext();
PsiElement element = place;
while (element != null) {
if (element instanceof PsiModifierListOwner) {
NullabilityAnnotationInfo result = getNullityDefault((PsiModifierListOwner)element, placeTargetTypes).forContext(place);