Merge remote-tracking branch 'origin/master' into amakeev/gradle

GitOrigin-RevId: f9a633252daf311ecab19002c0f4757052eee9dc
This commit is contained in:
Anton Makeev
2019-05-17 19:13:15 +03:00
committed by intellij-monorepo-bot
parent 47bb3d8475
commit c105e26db3
1938 changed files with 71469 additions and 5103 deletions
@@ -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) {
}
}
}
@@ -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();
}
@@ -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");
}
}
}