public class InitializationStore<V extends org.checkerframework.framework.flow.CFAbstractValue<V>,S extends InitializationStore<V,S>>
extends org.checkerframework.framework.flow.CFAbstractStore<V,S>
CFAbstractStore
and additionally tracks which fields of the 'self'
reference have been initialized.InitializationTransfer
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<javax.lang.model.element.VariableElement> |
initializedFields
The set of fields that are initialized.
|
protected java.util.Map<org.checkerframework.dataflow.analysis.FlowExpressions.FieldAccess,V> |
invariantFields
The set of fields that have 'invariant' annotation.
|
Constructor and Description |
---|
InitializationStore(org.checkerframework.framework.flow.CFAbstractAnalysis<V,S,?> analysis,
boolean sequentialSemantics) |
InitializationStore(S other)
A copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addInitializedField(org.checkerframework.dataflow.analysis.FlowExpressions.FieldAccess field)
Mark the field identified by the element
field as initialized (if it belongs to the
current class, or is static (in which case there is no aliasing issue and we can just add all
static fields). |
void |
addInitializedField(javax.lang.model.element.VariableElement f)
Mark the field identified by the element
f as initialized (the caller needs to ensure
that the field belongs to the current class, or is a static field). |
org.checkerframework.framework.flow.CFAbstractAnalysis<V,S,?> |
getAnalysis() |
java.util.Map<org.checkerframework.dataflow.analysis.FlowExpressions.FieldAccess,V> |
getFieldValues() |
void |
insertValue(org.checkerframework.dataflow.analysis.FlowExpressions.Receiver r,
V value) |
protected void |
internalVisualize(org.checkerframework.dataflow.cfg.CFGVisualizer<V,S,?> viz) |
boolean |
isFieldInitialized(javax.lang.model.element.Element f)
Is the field identified by the element
f initialized? |
S |
leastUpperBound(S other) |
protected boolean |
supersetOf(org.checkerframework.framework.flow.CFAbstractStore<V,S> o) |
void |
updateForMethodCall(org.checkerframework.dataflow.cfg.node.MethodInvocationNode n,
org.checkerframework.framework.type.AnnotatedTypeFactory atypeFactory,
V val) |
canAlias, canInsertReceiver, clearValue, copy, equals, getValue, getValue, getValue, getValue, getValue, getValue, hashCode, initializeMethodParameter, initializeThisValue, insertThisValue, insertValue, isMonotonicUpdate, isSideEffectFree, removeConflicting, removeConflicting, removeConflicting, replaceValue, toString, updateForArrayAssignment, updateForAssignment, updateForFieldAccessAssignment, updateForLocalVariableAssignment, visualize, widenedUpperBound
protected final java.util.Set<javax.lang.model.element.VariableElement> initializedFields
public InitializationStore(org.checkerframework.framework.flow.CFAbstractAnalysis<V,S,?> analysis, boolean sequentialSemantics)
public InitializationStore(S other)
public void insertValue(org.checkerframework.dataflow.analysis.FlowExpressions.Receiver r, V value)
If the receiver is a field, and has an invariant annotation, then it can be considered initialized.
public void updateForMethodCall(org.checkerframework.dataflow.cfg.node.MethodInvocationNode n, org.checkerframework.framework.type.AnnotatedTypeFactory atypeFactory, V val)
Additionally, the InitializationStore
keeps all field values for fields that have
the 'invariant' annotation.
public void addInitializedField(org.checkerframework.dataflow.analysis.FlowExpressions.FieldAccess field)
field
as initialized (if it belongs to the
current class, or is static (in which case there is no aliasing issue and we can just add all
static fields).public void addInitializedField(javax.lang.model.element.VariableElement f)
f
as initialized (the caller needs to ensure
that the field belongs to the current class, or is a static field).public boolean isFieldInitialized(javax.lang.model.element.Element f)
f
initialized?public S leastUpperBound(S other)
leastUpperBound
in interface org.checkerframework.dataflow.analysis.Store<S extends InitializationStore<V,S>>
leastUpperBound
in class org.checkerframework.framework.flow.CFAbstractStore<V extends org.checkerframework.framework.flow.CFAbstractValue<V>,S extends InitializationStore<V,S>>
protected void internalVisualize(org.checkerframework.dataflow.cfg.CFGVisualizer<V,S,?> viz)
public java.util.Map<org.checkerframework.dataflow.analysis.FlowExpressions.FieldAccess,V> getFieldValues()