mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
Merge remote-tracking branch 'origin/master' into amakeev/gradle
GitOrigin-RevId: f9a633252daf311ecab19002c0f4757052eee9dc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
47bb3d8475
commit
c105e26db3
+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;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class LambdaAutoCloseable {
|
||||
boolean opened;
|
||||
|
||||
void test3() throws Exception {
|
||||
opened = true;
|
||||
try( final AutoCloseable z = () -> {opened = false;}){
|
||||
}
|
||||
if (opened) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+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();
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
Value is always true (obj != null; line#13)
|
||||
'obj' was assigned (=; line#10)
|
||||
Expression cannot be null as it's newly created object (new Object(); line#10)
|
||||
*/
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class T {
|
||||
Object obj = new Object();
|
||||
|
||||
public T() {
|
||||
if (<selection>obj != null</selection>) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
Value is always true (right != null; line#11)
|
||||
'right' is known to be 'non-null' from line #10 (Objects.requireNonNull(right); line#10)
|
||||
*/
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class T {
|
||||
public T(Object right, boolean mode) {
|
||||
Objects.requireNonNull(right);
|
||||
if (mode && <selection>right != null</selection>) {
|
||||
System.out.println("okay");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user