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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.dataflow.analysis.Store
Store.FlowRule, Store.Kind
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
<FieldAccess, NullnessNoInitValue> Initialized fields and their values.protected boolean
protected boolean
Fields inherited from class org.checkerframework.framework.flow.CFAbstractStore
analysis, arrayValues, classValues, fieldValues, localVariableValues, methodValues, sequentialSemantics, thisValue
-
Constructor Summary
ConstructorDescriptionCreate a NullnessStore (copy constructor).NullnessNoInitStore
(CFAbstractAnalysis<NullnessNoInitValue, NullnessNoInitStore, ?> analysis, boolean sequentialSemantics) Create a NullnessStore. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Adds a representation of the internal information of this Store to visualizerviz
.boolean
boolean
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
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, newMonotonicFieldValueAfterMethodCall, removeConflicting, removeConflicting, removeConflicting, replaceValue, shouldInsert, toString, updateForArrayAssignment, updateForAssignment, updateForFieldAccessAssignment, updateForLocalVariableAssignment, updateForMethodCall, visualize, widenedUpperBound
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.plumelib.util.UniqueId
getClassAndUid
-
Field Details
-
isPolyNullNonNull
protected boolean isPolyNullNonNull -
isPolyNullNull
protected boolean isPolyNullNull -
initializedFields
Initialized fields and their values.This is used by
newFieldValueAfterMethodCall(FieldAccess, GenericAnnotatedTypeFactory, NullnessNoInitValue)
as cache to avoid performance issue in #1438.- See Also:
-
-
Constructor Details
-
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
Create a NullnessStore (copy constructor).- Parameters:
s
- a store to copy
-
-
Method Details
-
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
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
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
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() -
setPolyNullNull
public void setPolyNullNull(boolean isPolyNullNull)
-