Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added exceptions

...

For more details on using the private Object lock refer to CON02-J. Always synchronize on the appropriate object. There is some performance impact associated with using block synchronization instead of method synchronization but the difference is usually negligible. In the presence of statements that do not require synchronization amongst those that do, block synchronization tends to be a better performer.

Exceptions

EX1: Classes that are not public may violates this guideline as long as untrusted code cannot infiltrate the package.

EX2: If the deployment is not susceptible to untrusted invocations and untrusted code cannot directly or indirectly access the class object, this guideline may be violated.

Risk Assessment

Exposing the class object to untrusted code can result in denial-of-service.

...