public class LockStore extends CFAbstractStore<CFValue,LockStore>
Store.FlowRule, Store.Kind
Modifier and Type | Field and Description |
---|---|
protected boolean |
inConstructorOrInitializer
If true, indicates that the store refers to a point in the code inside a constructor or
initializer.
|
analysis, arrayValues, classValues, fieldValues, localVariableValues, methodValues, sequentialSemantics, thisValue
Constructor and Description |
---|
LockStore(LockAnalysis analysis,
boolean sequentialSemantics) |
LockStore(LockAnalysis analysis,
CFAbstractStore<CFValue,LockStore> other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
@Nullable CFValue |
getValue(FlowExpressions.Receiver expr) |
void |
insertLockPossiblyHeld(FlowExpressions.Receiver r) |
void |
insertValue(FlowExpressions.Receiver r,
@Nullable CFValue value)
Add the abstract value
value for the expression r (correctly deciding where
to store the information depending on the type of the expression r ). |
protected void |
internalVisualize(CFGVisualizer<CFValue,LockStore,?> viz)
Adds a representation of the internal information of this store to visualizer
viz . |
protected boolean |
isSideEffectFree(AnnotatedTypeFactory atypeFactory,
javax.lang.model.element.ExecutableElement method) |
LockStore |
leastUpperBound(LockStore other)
Compute the least upper bound of two stores.
|
void |
setInConstructorOrInitializer() |
void |
updateForMethodCall(MethodInvocationNode n,
AnnotatedTypeFactory atypeFactory,
CFValue val)
Remove any information that might not be valid any more after a method call, and add
information guaranteed by the method.
|
canAlias, canInsertReceiver, clearValue, copy, equals, getValue, getValue, getValue, getValue, getValue, hashCode, initializeMethodParameter, initializeThisValue, insertThisValue, insertValue, isMonotonicUpdate, removeConflicting, removeConflicting, removeConflicting, replaceValue, supersetOf, toString, updateForArrayAssignment, updateForAssignment, updateForFieldAccessAssignment, updateForLocalVariableAssignment, visualize, widenedUpperBound
protected boolean inConstructorOrInitializer
public LockStore(LockAnalysis analysis, boolean sequentialSemantics)
public LockStore(LockAnalysis analysis, CFAbstractStore<CFValue,LockStore> other)
public LockStore leastUpperBound(LockStore other)
Store
Important: This method must fulfill the following contract:
this
.
other
.
this
, even if the signature is
more permissive.
leastUpperBound
in interface Store<LockStore>
leastUpperBound
in class CFAbstractStore<CFValue,LockStore>
public void insertLockPossiblyHeld(FlowExpressions.Receiver r)
public void setInConstructorOrInitializer()
public @Nullable CFValue getValue(FlowExpressions.Receiver expr)
getValue
in class CFAbstractStore<CFValue,LockStore>
null
if no information is
available.protected void internalVisualize(CFGVisualizer<CFValue,LockStore,?> viz)
viz
.internalVisualize
in class CFAbstractStore<CFValue,LockStore>
protected boolean isSideEffectFree(AnnotatedTypeFactory atypeFactory, javax.lang.model.element.ExecutableElement method)
isSideEffectFree
in class CFAbstractStore<CFValue,LockStore>
public void updateForMethodCall(MethodInvocationNode n, AnnotatedTypeFactory atypeFactory, CFValue val)
CFAbstractStore
SideEffectFree
or Pure
), then no information needs to be removed.
a.f
needs to be removed, except
if the method n
cannot modify a.f
(e.g., if a
is a local
variable or this
, and f
is final).
val
in the store.updateForMethodCall
in class CFAbstractStore<CFValue,LockStore>
public void insertValue(FlowExpressions.Receiver r, @Nullable CFValue value)
CFAbstractStore
value
for the expression r
(correctly deciding where
to store the information depending on the type of the expression r
).
This method does not take care of removing other information that might be influenced by changes to certain parts of the state.
If there is already a value v
present for r
, then the stronger of the new
and old value are taken (according to the lattice). Note that this happens per hierarchy, and
if the store already contains information about a hierarchy for which value
does not
contain information, then that information is preserved.
insertValue
in class CFAbstractStore<CFValue,LockStore>