use of org.checkerframework.dataflow.analysis.FlowExpressions.ArrayAccess in project checker-framework by typetools.
the class LockStore method insertLockPossiblyHeld.
/*
* Insert an annotation exactly, without regard to whether an annotation was already present.
* This is only done for @LockPossiblyHeld. This is not sound for other type qualifiers.
*/
public void insertLockPossiblyHeld(FlowExpressions.Receiver r) {
if (r.containsUnknown()) {
// Expressions containing unknown expressions are not stored.
return;
}
if (r instanceof FlowExpressions.LocalVariable) {
FlowExpressions.LocalVariable localVar = (FlowExpressions.LocalVariable) r;
CFValue current = localVariableValues.get(localVar);
CFValue value = changeLockAnnoToTop(r, current);
localVariableValues.put(localVar, value);
} else if (r instanceof FlowExpressions.FieldAccess) {
FlowExpressions.FieldAccess fieldAcc = (FlowExpressions.FieldAccess) r;
CFValue current = fieldValues.get(fieldAcc);
CFValue value = changeLockAnnoToTop(r, current);
fieldValues.put(fieldAcc, value);
} else if (r instanceof FlowExpressions.MethodCall) {
FlowExpressions.MethodCall method = (FlowExpressions.MethodCall) r;
CFValue current = methodValues.get(method);
CFValue value = changeLockAnnoToTop(r, current);
methodValues.put(method, value);
} else if (r instanceof FlowExpressions.ArrayAccess) {
FlowExpressions.ArrayAccess arrayAccess = (ArrayAccess) r;
CFValue current = arrayValues.get(arrayAccess);
CFValue value = changeLockAnnoToTop(r, current);
arrayValues.put(arrayAccess, value);
} else if (r instanceof FlowExpressions.ThisReference) {
thisValue = changeLockAnnoToTop(r, thisValue);
} else if (r instanceof FlowExpressions.ClassName) {
FlowExpressions.ClassName className = (FlowExpressions.ClassName) r;
CFValue current = classValues.get(className);
CFValue value = changeLockAnnoToTop(r, current);
classValues.put(className, value);
} else {
// No other types of expressions need to be stored.
}
}
Aggregations