mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
BytecodeAnalysis: infer @NotNull for static final fields (for now: non-branching clinit only)
Fixes IDEA-223861 Infer static field nullability from the bytecode GitOrigin-RevId: 2ee3102df5677e567defbe849900769237a728bc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5e86efe5f2
commit
79cc904ff9
@@ -0,0 +1,22 @@
|
||||
package bytecodeAnalysis.data;
|
||||
|
||||
import bytecodeAnalysis.ExpectNotNull;
|
||||
import bytecodeAnalysis.ExpectContract;
|
||||
|
||||
public class TestField {
|
||||
@ExpectNotNull
|
||||
public static final Object O1 = new Object();
|
||||
@ExpectNotNull
|
||||
public static final Object O2 = getObject();
|
||||
@ExpectNotNull
|
||||
public static final Runnable O3 = () -> {};
|
||||
|
||||
public static Object O4 = new Object(); // non-final
|
||||
public final Object O5 = new Object(); // non-static
|
||||
|
||||
@ExpectNotNull
|
||||
@ExpectContract(value="->new",pure=true)
|
||||
private static Object getObject() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user