Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor fix of prev edit

...

Synchronization is a more secure alternative in situations where the volatile keyword or a java.util.concurrent.atomic.Atomic* field is inappropriate, such as if a variable's new value depends on its current value. Refer to CON01-J. Ensure that compound operations on shared variables are atomic for more information.

The Compliance with the guideline CON04-J. Synchronize using an internal private final lock object reduces the likelihood of misuse by ensuring that untrusted callers cannot access the lock object.

...