Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added the general recommendation to the intro

...

If these restrictions are not met, the object's intrinsic lock is not trustworthy. If all conditions are satisfied, then the object gains no significant security from using a private final lock object, and may synchronize using its own intrinsic lock. However, because classes may be used by trusted code in unexpected ways, block synchronization using a private final lock object is generally recommended.

Noncompliant Code Example (method synchronization)

...