Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Synchronize on the original Collection object when using synchronization wrappers. This synchronization is necessary to enforce atomicity (CON07-J. Do not assume that a grouping of calls to independently atomic methods is atomic).

This also applies to java.util.Map objects, even though Maps are technically not Collections.

Noncompliant Code Example (collection view)

...