[java-analysis] ProjectBytecodeAnalysis: do not rewrite null->x contract with _->x if notnull parameter was inferred

Fixes IDEA-354381 Unreachable code inspection fails when using Streamable.of()
Unfortunately, the test does not differentiate the bug. I failed to write a good test in a reasonable amount of time. Nevertheless, the original issue is fixed.

GitOrigin-RevId: 55b0f169c93d1cef9453c3eb88959ea4832a917a
This commit is contained in:
Tagir Valeev
2024-06-17 18:59:38 +02:00
committed by intellij-monorepo-bot
parent 8e90196a7f
commit 191e65634e
4 changed files with 16 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import java.io.IOException;
import java.lang.reflect.Array;
import java.nio.file.Files;
import java.util.List;
import java.util.Objects;
import java.util.ArrayList;
@SuppressWarnings({"unused", "IOResourceOpenedButNotSafelyClosed"})
@@ -45,6 +46,11 @@ public class Test01 {
}
}
static @ExpectNotNull Runnable doubleCheck(Object obj) {
checkNotNullVoid(obj, "obj");
return checkNotNull(obj, "obj")::hashCode;
}
native static String createMessage(String s1, String s2);
@ExpectNotNull