Class NullnessNoInitStore
- java.lang.Object
-
- org.checkerframework.framework.flow.CFAbstractStore<NullnessNoInitValue,NullnessNoInitStore>
-
- org.checkerframework.checker.nullness.NullnessNoInitStore
-
- All Implemented Interfaces:
Store<NullnessNoInitStore>
,org.plumelib.util.UniqueId
public class NullnessNoInitStore extends CFAbstractStore<NullnessNoInitValue,NullnessNoInitStore>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.checkerframework.dataflow.analysis.Store
Store.FlowRule, Store.Kind
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<FieldAccess,NullnessNoInitValue>
initializedFields
Initialized fields and their values.protected boolean
isPolyNullNonNull
protected boolean
isPolyNullNull
-
Fields inherited from class org.checkerframework.framework.flow.CFAbstractStore
analysis, arrayValues, classValues, fieldValues, localVariableValues, methodValues, sequentialSemantics, thisValue
-
-
Constructor Summary
Constructors Constructor Description NullnessNoInitStore(NullnessNoInitStore s)
Create a NullnessStore (copy constructor).NullnessNoInitStore(CFAbstractAnalysis<NullnessNoInitValue,NullnessNoInitStore,?> analysis, boolean sequentialSemantics)
Create a NullnessStore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
internalVisualize(CFGVisualizer<NullnessNoInitValue,NullnessNoInitStore,?> viz)
Adds a representation of the internal information of this Store to visualizerviz
.boolean
isPolyNullNonNull()
boolean
isPolyNullNull()
NullnessNoInitStore
leastUpperBound(NullnessNoInitStore other)
Compute the least upper bound of two stores.protected NullnessNoInitValue
newFieldValueAfterMethodCall(FieldAccess fieldAccess, GenericAnnotatedTypeFactory<NullnessNoInitValue,NullnessNoInitStore,?,?> atypeFactory, NullnessNoInitValue value)
Returns the new value of a field after a method call, ornull
if the field should be removed from the store.void
setPolyNullNonNull(boolean isPolyNullNonNull)
void
setPolyNullNull(boolean isPolyNullNull)
protected boolean
supersetOf(CFAbstractStore<NullnessNoInitValue,NullnessNoInitStore> o)
Returns true iff thisCFAbstractStore
contains a superset of the map entries of the argumentCFAbstractStore
.-
Methods inherited from class org.checkerframework.framework.flow.CFAbstractStore
canAlias, canInsertJavaExpression, clearValue, computeNewValueAndInsert, copy, equals, getFieldValue, getFieldValues, getUid, getValue, getValue, getValue, getValue, getValue, getValue, hashCode, initializeMethodParameter, initializeThisValue, insertOrRefine, insertOrRefine, insertOrRefinePermitNondeterministic, insertThisValue, insertValue, insertValue, insertValue, insertValuePermitNondeterministic, insertValuePermitNondeterministic, isMonotonicUpdate, isSideEffectFree, newMonotonicFieldValueAfterMethodCall, removeConflicting, removeConflicting, removeConflicting, replaceValue, shouldInsert, toString, updateForArrayAssignment, updateForAssignment, updateForFieldAccessAssignment, updateForLocalVariableAssignment, updateForMethodCall, visualize, widenedUpperBound
-
-
-
-
Field Detail
-
isPolyNullNonNull
protected boolean isPolyNullNonNull
-
isPolyNullNull
protected boolean isPolyNullNull
-
initializedFields
protected java.util.Map<FieldAccess,NullnessNoInitValue> initializedFields
Initialized fields and their values.This is used by
newFieldValueAfterMethodCall(FieldAccess, GenericAnnotatedTypeFactory, NullnessNoInitValue)
as cache to avoid performance issue in #1438.
-
-
Constructor Detail
-
NullnessNoInitStore
public NullnessNoInitStore(CFAbstractAnalysis<NullnessNoInitValue,NullnessNoInitStore,?> analysis, boolean sequentialSemantics)
Create a NullnessStore.- Parameters:
analysis
- the analysis class this store belongs tosequentialSemantics
- should the analysis use sequential Java semantics (i.e., assume that only one thread is running at all times)?
-
NullnessNoInitStore
public NullnessNoInitStore(NullnessNoInitStore s)
Create a NullnessStore (copy constructor).- Parameters:
s
- a store to copy
-
-
Method Detail
-
newFieldValueAfterMethodCall
protected NullnessNoInitValue newFieldValueAfterMethodCall(FieldAccess fieldAccess, GenericAnnotatedTypeFactory<NullnessNoInitValue,NullnessNoInitStore,?,?> atypeFactory, NullnessNoInitValue value)
Description copied from class:CFAbstractStore
Returns the new value of a field after a method call, ornull
if the field should be removed from the store.In this default implementation, the field's value is preserved if it is either unassignable (see
FieldAccess.isUnassignableByOtherCode()
) or has a monotonic qualifier (seeCFAbstractStore.newMonotonicFieldValueAfterMethodCall(FieldAccess, GenericAnnotatedTypeFactory, CFAbstractValue)
). Otherwise, it is removed from the store.- Overrides:
newFieldValueAfterMethodCall
in classCFAbstractStore<NullnessNoInitValue,NullnessNoInitStore>
- Parameters:
fieldAccess
- the field whose value to updateatypeFactory
- AnnotatedTypeFactory of the associated checkervalue
- the field's value before the method call- Returns:
- the field's value after the method call, or
null
if the field should be removed from the store
-
leastUpperBound
public NullnessNoInitStore leastUpperBound(NullnessNoInitStore other)
Description copied from interface:Store
Compute the least upper bound of two stores.Important: This method must fulfill the following contract:
- Does not change
this
. - Does not change
other
. - Returns a fresh object which is not aliased yet.
- Returns an object of the same (dynamic) type as
this
, even if the signature is more permissive. - Is commutative.
- Specified by:
leastUpperBound
in interfaceStore<NullnessNoInitStore>
- Overrides:
leastUpperBound
in classCFAbstractStore<NullnessNoInitValue,NullnessNoInitStore>
- Does not change
-
supersetOf
protected boolean supersetOf(CFAbstractStore<NullnessNoInitValue,NullnessNoInitStore> o)
Description copied from class:CFAbstractStore
Returns true iff thisCFAbstractStore
contains a superset of the map entries of the argumentCFAbstractStore
. Note that we test the entry keys and values by Java equality, not by any subtype relationship. This method is used primarily to simplify the equals predicate.- Overrides:
supersetOf
in classCFAbstractStore<NullnessNoInitValue,NullnessNoInitStore>
-
internalVisualize
protected java.lang.String internalVisualize(CFGVisualizer<NullnessNoInitValue,NullnessNoInitStore,?> viz)
Description copied from class:CFAbstractStore
Adds a representation of the internal information of this Store to visualizerviz
.- Overrides:
internalVisualize
in classCFAbstractStore<NullnessNoInitValue,NullnessNoInitStore>
- Parameters:
viz
- the visualizer- Returns:
- a representation of the internal information of this
Store
-
isPolyNullNonNull
public boolean isPolyNullNonNull()
-
setPolyNullNonNull
public void setPolyNullNonNull(boolean isPolyNullNonNull)
-
isPolyNullNull
public boolean isPolyNullNull()
-
-