mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-224546 "Cannot annotate with both @NotNull and @NotNull" warning
GitOrigin-RevId: 28ff56adebd81918856c5a562cda051e52a33c32
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3339a4762c
commit
c2af9c1d1f
@@ -334,7 +334,9 @@ public abstract class NullableNotNullManager {
|
||||
: findAnnotation(owner, qualifiedNames);
|
||||
PsiType type = getOwnerType(owner);
|
||||
if (memberAnno != null) {
|
||||
return preferTypeAnnotation(memberAnno, type);
|
||||
PsiAnnotation annotation = preferTypeAnnotation(memberAnno, type);
|
||||
if (annotation != memberAnno && !qualifiedNames.contains(annotation.getQualifiedName())) return null;
|
||||
return annotation;
|
||||
}
|
||||
if (type != null) {
|
||||
return ContainerUtil.find(type.getAnnotations(), a -> qualifiedNames.contains(a.getQualifiedName()));
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
interface Y {
|
||||
@withTypeUse.Nullable Object @withTypeUse.NotNull [] arr();
|
||||
}
|
||||
+5
@@ -69,6 +69,11 @@ public class NullableStuffInspectionTest extends LightJavaCodeInsightFixtureTest
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAnnotatingArrayAmbiguous() {
|
||||
DataFlowInspection8Test.setupAmbiguousAnnotations("withTypeUse", myFixture);
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testProblems2() { doTest(); }
|
||||
public void testNullableFieldNotnullParam() { doTest(); }
|
||||
public void testNotNullFieldNullableParam() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user