...
Using a private lock may only be achieved with block synchronization, as static method synchronization always uses the intrinsic lock of the object's class. However, block synchronization is also preferred over method synchronization, because it is easy to move operations out of the synchronized block when they might take a long time and they are not truly a critical section.
Exceptions
EX1: A Class class may violate this guideline, if all the following conditions are met:
- it sufficiently documents that callers must not pass objects of this class to untrusted code.,
- trusted callers must do not use any untrusted classes that violate this guideline directly or indirectly,
- finallyand, this the class must document documents proper usage of its intrinsic lock, and that is, when external classes may use the intrinsic lock, and when they may not.
...