Class ConditionalTransferResult<V extends AbstractValue<V>,S extends Store<S>>
- Type Parameters:
V- type of the abstract value that is trackedS- the store type used in the analysis
TransferResult with two non-exceptional stores. The 'then' store
contains information valid when the previous boolean-valued expression was true, and the 'else'
store contains information valid when the expression was false.
getRegularStore() returns the least upper bound of the two underlying stores.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SThe 'else' result store.protected final SThe 'then' result store.Fields inherited from class org.checkerframework.dataflow.analysis.TransferResult
exceptionalStores, resultValue -
Constructor Summary
ConstructorsConstructorDescriptionConditionalTransferResult(@Nullable V value, S thenStore, S elseStore) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean), usingfalsefor whether the store changed andnullforTransferResult.exceptionalStores.ConditionalTransferResult(@Nullable V value, S thenStore, S elseStore, boolean storeChanged) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean), usingnullforTransferResult.exceptionalStores.ConditionalTransferResult(@Nullable V value, S thenStore, S elseStore, @Nullable Map<TypeMirror, S> exceptionalStores, boolean storeChanged) Create aConditionalTransferResultwiththenStoreas the resulting store if the correspondingNodeevaluates totrueandelseStoreotherwise.ConditionalTransferResult(V value, S thenStore, S elseStore, @Nullable Map<TypeMirror, S> exceptionalStores) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean), usingfalsefor thestoreChangedformal parameter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif and only if this transfer result contains two stores that are potentially not equal.Returns the result store produced if theNodethis result belongs to evaluates tofalse.Returns the regular result store produced if no exception is thrown by theNodecorresponding to this transfer function result.Returns the result store produced if theNodethis result belongs to evaluates totrue.booleanReturnstrueif and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore.toString()withExceptionalStores(Map<TypeMirror, S> exceptionalStores) Construct a shallow copy of thisTransferResult, but with the givenexceptionalStores.Methods inherited from class org.checkerframework.dataflow.analysis.TransferResult
getExceptionalStore, getExceptionalStores, getResultValue, setResultValue
-
Field Details
-
thenStore
The 'then' result store. -
elseStore
The 'else' result store.
-
-
Constructor Details
-
ConditionalTransferResult
Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean), usingnullforTransferResult.exceptionalStores.Exceptions: If the corresponding
Nodethrows an exception, then it is assumed that no special handling is necessary and the store before the correspondingNodewill be passed along any exceptional edge.Aliasing:
thenStoreandelseStoreare not allowed to be used anywhere outside of this class (including use through aliases). Complete control over the objects is transferred to this class.- Parameters:
value- the abstract value produced by the transfer functionthenStore- 'then' result storeelseStore- 'else' result storestoreChanged- true if the store changed- See Also:
-
ConditionalTransferResult
Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean), usingfalsefor whether the store changed andnullforTransferResult.exceptionalStores. -
ConditionalTransferResult
public ConditionalTransferResult(V value, S thenStore, S elseStore, @Nullable Map<TypeMirror, S> exceptionalStores) Create a newConditionalTransferResult(AbstractValue, Store, Store, Map, boolean), usingfalsefor thestoreChangedformal parameter.- Parameters:
value- the abstract value produced by the transfer functionthenStore-thenStoreelseStore-elseStoreexceptionalStores-TransferResult.exceptionalStores- See Also:
-
ConditionalTransferResult
public ConditionalTransferResult(@Nullable V value, S thenStore, S elseStore, @Nullable Map<TypeMirror, S> exceptionalStores, boolean storeChanged) Create aConditionalTransferResultwiththenStoreas the resulting store if the correspondingNodeevaluates totrueandelseStoreotherwise.Exceptions: If the corresponding
Nodethrows an exception, then the corresponding store inexceptionalStoresis used. If no exception is found inexceptionalStores, then it is assumed that no special handling is necessary and the store before the correspondingNodewill be passed along any exceptional edge.Aliasing:
thenStore,elseStore, and any store inexceptionalStoresare not allowed to be used anywhere outside of this class (including use through aliases). Complete control over the objects is transferred to this class.- Parameters:
value- the abstract value produced by the transfer functionthenStore-thenStoreelseStore-elseStoreexceptionalStores-TransferResult.exceptionalStoresstoreChanged- true if the store changed; seeTransferResult.storeChanged().
-
-
Method Details
-
getRegularStore
Description copied from class:TransferResultReturns the regular result store produced if no exception is thrown by theNodecorresponding to this transfer function result.- Specified by:
getRegularStorein classTransferResult<V extends AbstractValue<V>,S extends Store<S>> - Returns:
- the regular result store produced if no exception is thrown by the
Nodecorresponding to this transfer function result
-
getThenStore
Description copied from class:TransferResultReturns the result store produced if theNodethis result belongs to evaluates totrue.- Specified by:
getThenStorein classTransferResult<V extends AbstractValue<V>,S extends Store<S>> - Returns:
- the result store produced if the
Nodethis result belongs to evaluates totrue
-
getElseStore
Description copied from class:TransferResultReturns the result store produced if theNodethis result belongs to evaluates tofalse.- Specified by:
getElseStorein classTransferResult<V extends AbstractValue<V>,S extends Store<S>> - Returns:
- the result store produced if the
Nodethis result belongs to evaluates tofalse
-
containsTwoStores
public boolean containsTwoStores()Description copied from class:TransferResultReturnstrueif and only if this transfer result contains two stores that are potentially not equal. Note that the resulttruedoes not imply thatgetRegularStorecannot be called (or vice versa forfalse). Rather, it indicates thatgetThenStoreorgetElseStorecan be used to give more precise results. Otherwise, if the result isfalse, then all three methodsgetRegularStore,getThenStore, andgetElseStorereturn equivalent stores.- Specified by:
containsTwoStoresin classTransferResult<V extends AbstractValue<V>,S extends Store<S>> - Returns:
trueif and only if this transfer result contains two stores that are potentially not equal
-
toString
-
storeChanged
public boolean storeChanged()Description copied from class:TransferResultReturnstrueif and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore.- Specified by:
storeChangedin classTransferResult<V extends AbstractValue<V>,S extends Store<S>> - Returns:
trueif and only if the transfer function returning this transfer result changed the regularStore, elseStore, or thenStore
-
withExceptionalStores
Description copied from class:TransferResultConstruct a shallow copy of thisTransferResult, but with the givenexceptionalStores.- Specified by:
withExceptionalStoresin classTransferResult<V extends AbstractValue<V>,S extends Store<S>> - Parameters:
exceptionalStores- the new exceptional stores to use- Returns:
- a copy of this object modified to use the given exceptional stores
- See Also:
-