use of org.checkerframework.dataflow.expression.MethodCall in project checker-framework by typetools.
the class LockStore method insertValue.
@Override
public void insertValue(JavaExpression je, @Nullable CFValue value, boolean permitNondeterministic) {
if (!shouldInsert(je, value, permitNondeterministic)) {
return;
}
// side effect the lock expression that has value @LockHeld.
if (hasLockHeld(value)) {
if (je instanceof FieldAccess) {
FieldAccess fieldAcc = (FieldAccess) je;
CFValue oldValue = fieldValues.get(fieldAcc);
CFValue newValue = value.mostSpecific(oldValue, null);
if (newValue != null) {
fieldValues.put(fieldAcc, newValue);
}
} else if (je instanceof MethodCall) {
MethodCall method = (MethodCall) je;
CFValue oldValue = methodValues.get(method);
CFValue newValue = value.mostSpecific(oldValue, null);
if (newValue != null) {
methodValues.put(method, newValue);
}
}
}
super.insertValue(je, value, permitNondeterministic);
}
Aggregations