continue;
}
// Get lock set and instance value
ValueNumber thisValue = !method.isStatic() ? vnaDataflow.getAnalysis().getThisValue() : null;
LockSet lockSet = lockChecker.getFactAtLocation(location);
InstructionHandle handle = location.getHandle();
ValueNumber instance = frame.getInstance(handle.getInstruction(), cpg);
if (DEBUG) {
System.out.println("Lock set: " + lockSet);
System.out.println("value number: " + instance.getNumber());
System.out.println("Lock count: " + lockSet.getLockCount(instance.getNumber()));
}
// Is the instance locked?
// We consider the access to be locked if either
// - the object is explicitly locked, or
// - the field is accessed through the "this" reference,
// and the method is in the locked method set, or
// - any value returned by a called method is locked;
// the (conservative) assumption is that the return lock object
// is correct for synchronizing the access
boolean isExplicitlyLocked = lockSet.getLockCount(instance.getNumber()) > 0;
boolean isAccessedThroughThis = thisValue != null && thisValue.equals(instance);
boolean isLocked = isExplicitlyLocked
|| ((isConstructor(method.getName()) || lockedMethodSet.contains(method)) && isAccessedThroughThis)
|| lockSet.containsReturnValue(vnaDataflow.getAnalysis().getFactory());
// Adjust the field so its class name is the same
// as the type of reference it is accessed through.
// This helps fix false positives produced when a
// threadsafe class is extended by a subclass that