mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
make AnnotationUtil.findOwnAnnotation skip type annotations inapplicable to declarations (IDEA-CR-47125, IDEA-210087)
GitOrigin-RevId: 677b8286169bda976caab66a18881729182c7e04
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6e57ba824d
commit
02fcb39a75
+1
-1
@@ -2,7 +2,7 @@ import foo.*;
|
||||
|
||||
class IgnoreNullabilityOnPrimitiveCast {
|
||||
private static int map(@Nullable int[] mapping, int idx) {
|
||||
return <warning descr="Array access 'mapping[idx]' may produce 'NullPointerException'">mapping[idx]</warning>;
|
||||
return mapping[idx];
|
||||
}
|
||||
|
||||
static final int TEST;
|
||||
|
||||
+18
-5
@@ -1,15 +1,28 @@
|
||||
import foo.Nullable;
|
||||
|
||||
class Bar {
|
||||
private @Nullable Object[] typeUseAmbiguity(Object o) {
|
||||
@Nullable Object[] a = (@Nullable Object[]) o;
|
||||
private @mixed.Nullable Object[] typeUseAmbiguity(Object o) {
|
||||
@mixed.Nullable Object[] a = (@mixed.Nullable Object[]) o;
|
||||
if (a == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
private @<warning descr="@Nullable method 'noAmbiguity' always returns a non-null value">Nullable</warning> Object noAmbiguity(Object o) {
|
||||
private @<warning descr="@Nullable method 'noAmbiguity' always returns a non-null value">mixed.Nullable</warning> Object noAmbiguity(Object o) {
|
||||
if (o == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
private @typeUse.Nullable Object[] typeUseArray(Object o) {
|
||||
@typeUse.Nullable Object[] a = (@typeUse.Nullable Object[]) o;
|
||||
if (a == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
private @<warning descr="@Nullable method 'typeUsePlain' always returns a non-null value">typeUse.Nullable</warning> Object typeUsePlain(Object o) {
|
||||
if (o == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user