No. The use of the lock object itself, the Foo.class
object in this case, is unaffected by synchronized blocks using it as a lock object.
You can't stop classes from using being used, unless you put them behind something like a proxy that controls access, or make the methods themselves conditionally block execution internally, which doesn't really prevent access but simulates it.