summaryrefslogtreecommitdiff
path: root/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java')
-rw-r--r--java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java
index 8309670020ab..106267affda4 100644
--- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java
+++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java
@@ -59,4 +59,13 @@ public interface DfaMemoryState {
@Nullable
DfaConstValue getConstantValue(DfaVariableValue value);
+
+ /**
+ * Ephemeral means a state that was created when considering a method contract and checking if one of its arguments is null.
+ * With explicit null check, that would result in any non-annotated variable being treated as nullable and producing possible NPE warnings later.
+ * With contracts, we don't want this. So the state where this variable is null is marked ephemeral and no NPE warnings are issued for such states.
+ */
+ void markEphemeral();
+
+ boolean isEphemeral();
}