Class NullnessNoInitStore
java.lang.Object
org.checkerframework.framework.flow.CFAbstractStore<CFValue,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
FieldsModifier and TypeFieldDescriptionprotected @Nullable Set<JavaExpression> Receivers that are currently known to be non-empty queues.Fields inherited from class org.checkerframework.framework.flow.CFAbstractStore
analysis, arrayValues, classValues, fieldValues, localVariableValues, methodCallExpressions, sequentialSemantics, thisValue -
Constructor Summary
ConstructorsConstructorDescriptionCreate a NullnessStore (copy constructor).NullnessNoInitStore(CFAbstractAnalysis<CFValue, NullnessNoInitStore, ?> analysis, boolean sequentialSemantics) Create a NullnessStore. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this is equal to the given argument.inthashCode()protected StringAdds a representation of the internal information of this Store to visualizerviz.booleanbooleanisQueueNonEmpty(JavaExpression receiver) Returns true if the receiver is known to be a non-empty queue.Computes the least upper bound (LUB) of this store and another store.voidmarkQueueAsNonEmpty(JavaExpression receiver) Marks the receiver as a queue known to be non-empty.protected CFValuenewFieldValueAfterMethodCall(FieldAccess fieldAccess, GenericAnnotatedTypeFactory<CFValue, NullnessNoInitStore, ?, ?> atypeFactory, CFValue value) Returns the new value of a field after a method call, ornullif the field should be removed from the store.voidsetPolyNullNull(boolean isPolyNullNull) protected booleanReturns true iff thisCFAbstractStorecontains a superset of the map entries of the argumentCFAbstractStore.voidupdateForAssignment(Node n, @Nullable CFValue val) Update the information in the store by considering an assignment with targetn.voidupdateForMethodCall(MethodInvocationNode methodInvocationNode, GenericAnnotatedTypeFactory<CFValue, NullnessNoInitStore, ?, ?> atypeFactory, CFValue val) Remove any information that might not be valid any more after a method call, and add information guaranteed by the method.Methods inherited from class org.checkerframework.framework.flow.CFAbstractStore
canAlias, canInsertJavaExpression, clearValue, computeNewValueAndInsert, copy, getFieldValue, getFieldValues, getUid, getValue, getValue, getValue, getValue, getValue, getValue, initializeMethodParameter, initializeThisValue, insertOrRefine, insertOrRefine, insertThisValue, insertValue, insertValue, insertValue, insertValuePermitImpure, insertValuePermitImpure, isMonotonicUpdate, newMonotonicFieldValueAfterMethodCall, removeConflicting, removeConflicting, removeConflicting, replaceValue, replaceValue, shouldInsert, toString, updateForArrayAssignment, updateForFieldAccessAssignment, updateForLocalVariableAssignment, visualize, widenedUpperBoundMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.plumelib.util.UniqueId
getClassAndUid
-
Field Details
-
nonEmptyQueueReceivers
Receivers that are currently known to be non-empty queues.Null if no queues are known to be non-empty, to avoid allocation overhead on empty stores.
-
-
Constructor Details
-
NullnessNoInitStore
public NullnessNoInitStore(CFAbstractAnalysis<CFValue, 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
-
markQueueAsNonEmpty
Marks the receiver as a queue known to be non-empty.- Parameters:
receiver- a queue receiver expression
-
isQueueNonEmpty
Returns true if the receiver is known to be a non-empty queue.- Parameters:
receiver- a queue receiver expression- Returns:
- true if the receiver is known to be a non-empty queue
-
updateForAssignment
Description copied from class:CFAbstractStoreUpdate the information in the store by considering an assignment with targetn.- Overrides:
updateForAssignmentin classCFAbstractStore<CFValue,NullnessNoInitStore> - Parameters:
n- the left-hand side of an assignmentval- the right-hand value of an assignment
-
updateForMethodCall
public void updateForMethodCall(MethodInvocationNode methodInvocationNode, GenericAnnotatedTypeFactory<CFValue, NullnessNoInitStore, ?, ?> atypeFactory, CFValue val) Description copied from class:CFAbstractStoreRemove any information that might not be valid any more after a method call, and add information guaranteed by the method.- If the method is side-effect-free (as indicated by
SideEffectFreeorPure), then no information needs to be removed. - Otherwise, all information about field accesses
a.fneeds to be removed, except if the methodncannot modifya.f. This unmodifiability property holds ifais a local variable orthis, andfis final, or ifa.fhas aMonotonicQualifierin the current store. Subclasses can change this behavior by overridingCFAbstractStore.newFieldValueAfterMethodCall(FieldAccess, GenericAnnotatedTypeFactory, CFAbstractValue). - Furthermore, if the field has a monotonic annotation, then its information can also be kept.
JavaExpression.isPure(org.checkerframework.javacutil.AnnotationProvider)), we store its resultvalin the store. Contracts may store a fact about a call that is not pure.- Overrides:
updateForMethodCallin classCFAbstractStore<CFValue,NullnessNoInitStore> - Parameters:
methodInvocationNode- method whose information is being updatedatypeFactory- the type factory of the associated checkerval- abstract value of the method call
- If the method is side-effect-free (as indicated by
-
newFieldValueAfterMethodCall
protected CFValue newFieldValueAfterMethodCall(FieldAccess fieldAccess, GenericAnnotatedTypeFactory<CFValue, NullnessNoInitStore, ?, ?> atypeFactory, CFValue value) Description copied from class:CFAbstractStoreReturns the new value of a field after a method call, ornullif 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.isAssignableByOtherCode()) or has a monotonic qualifier (seeCFAbstractStore.newMonotonicFieldValueAfterMethodCall(FieldAccess, GenericAnnotatedTypeFactory, CFAbstractValue)). Otherwise, it is removed from the store.- Overrides:
newFieldValueAfterMethodCallin classCFAbstractStore<CFValue,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
nullif the field should be removed from the store
-
leastUpperBound
Description copied from class:CFAbstractStoreComputes the least upper bound (LUB) of this store and another store. The LUB represents a program state that is true if either this store or the other store is true.- Specified by:
leastUpperBoundin interfaceStore<NullnessNoInitStore>- Overrides:
leastUpperBoundin classCFAbstractStore<CFValue,NullnessNoInitStore> - Parameters:
other- the store to merge with this one- Returns:
- a new store that represents the LUB of this store and the other
-
supersetOf
Description copied from class:CFAbstractStoreReturns true iff thisCFAbstractStorecontains 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:
supersetOfin classCFAbstractStore<CFValue,NullnessNoInitStore> - Parameters:
o- the other store- Returns:
- true iff this store contains a superset of the map entries in the other store
-
internalVisualize
Description copied from class:CFAbstractStoreAdds a representation of the internal information of this Store to visualizerviz.- Overrides:
internalVisualizein classCFAbstractStore<CFValue,NullnessNoInitStore> - Parameters:
viz- the visualizer- Returns:
- a representation of the internal information of this
Store
-
isPolyNullNull
public boolean isPolyNullNull() -
setPolyNullNull
public void setPolyNullNull(boolean isPolyNullNull) -
equals
Description copied from interface:StoreReturns true if this is equal to the given argument.- Specified by:
equalsin interfaceStore<NullnessNoInitStore>- Overrides:
equalsin classCFAbstractStore<CFValue,NullnessNoInitStore> - Parameters:
o- the object to compare against this- Returns:
- true if this is equal to the given argument
-
hashCode
public int hashCode()- Overrides:
hashCodein classCFAbstractStore<CFValue,NullnessNoInitStore>
-