...
Code Block | ||
---|---|---|
| ||
private final Object lock = new Object(); synchronized(lock) { // ... } |
For more information on using an Object
as a lock, see CON04-J. Synchronize using an internal private final lock object.
Noncompliant Code Example (interned String
object)
...