mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
array which elements are @NotNull -> array of @NotNull elements
Review ID: IDEA-CR-24027
This commit is contained in:
+5
-5
@@ -19,17 +19,17 @@ class FooImpl implements Foo {
|
||||
return null;
|
||||
}
|
||||
else if (Math.random() > 0.5) {
|
||||
@NotNull Object @Nullable [] arr1 = new Object[]{<warning descr="'null' is stored to an array which elements are @NotNull">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
@NotNull Object @Nullable [] arr2 = {<warning descr="'null' is stored to an array which elements are @NotNull">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
return new Object[]{<warning descr="'null' is stored to an array which elements are @NotNull">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
@NotNull Object @Nullable [] arr1 = new Object[]{<warning descr="'null' is stored to an array of @NotNull elements">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
@NotNull Object @Nullable [] arr2 = {<warning descr="'null' is stored to an array of @NotNull elements">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
return new Object[]{<warning descr="'null' is stored to an array of @NotNull elements">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
}
|
||||
return new @NotNull Object @Nullable []{<warning descr="'null' is stored to an array which elements are @NotNull">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
return new @NotNull Object @Nullable []{<warning descr="'null' is stored to an array of @NotNull elements">null</warning>, new Object(), <warning descr="Expression 'Math.random() > 0.5 ? new Object() : null' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? new Object() : null</warning>};
|
||||
}
|
||||
|
||||
void test() {
|
||||
@NotNull Object @Nullable [] array = getNullableArrayOfNotNullObjects();
|
||||
assert array != null;
|
||||
array[0] = <warning descr="'null' is stored to an array which elements are @NotNull">null</warning>;
|
||||
array[0] = <warning descr="'null' is stored to an array of @NotNull elements">null</warning>;
|
||||
array[1] = <warning descr="Expression 'Math.random() > 0.5 ? null : \"foo\"' might evaluate to null but is stored to an array of @NotNull elements">Math.random() > 0.5 ? null : "foo"</warning>;
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ dataflow.message.passing.nullable.argument=Argument <code>#ref</code> #loc might
|
||||
dataflow.message.passing.nullable.argument.methodref=Method reference argument might be null
|
||||
dataflow.message.assigning.null=<code>null</code> is assigned to a variable that is annotated with @NotNull
|
||||
dataflow.message.assigning.nullable=Expression <code>#ref</code> might evaluate to null but is assigned to a variable that is annotated with @NotNull
|
||||
dataflow.message.storing.array.null=<code>null</code> is stored to an array which elements are @NotNull
|
||||
dataflow.message.storing.array.null=<code>null</code> is stored to an array of @NotNull elements
|
||||
dataflow.message.storing.array.nullable=Expression <code>#ref</code> might evaluate to null but is stored to an array of @NotNull elements
|
||||
dataflow.message.return.null.from.notnull=<code>null</code> is returned by the method declared as @{0}
|
||||
dataflow.message.return.nullable.from.notnull=Expression <code>#ref</code> might evaluate to null but is returned by the method declared as @{0}
|
||||
|
||||
Reference in New Issue
Block a user