...
A class that does not provide any accessible methods to change the lock is secure against un-trusted untrusted manipulation. However, it is susceptible to inadvertent modification by the programmer. For maintainability reasons, eliminating the accessor method (which is presumably needed for other reasons) is not the preferred solution.
...
In this compliant solution, ChangeValue()
obtains a lock on a private static private Object
that is inaccessible to the caller.
...