Skip to content

Files

Latest commit

 

History

History
11 lines (6 loc) · 479 Bytes

SynchronizedOnGetClass.md

File metadata and controls

11 lines (6 loc) · 479 Bytes

Pattern: Synchronized on getClass()

Issue: -

Description

Checks for synchronization on getClass() rather than class literal. This instance method synchronizes on this.getClass(). If this class is subclassed, subclasses will synchronize on the class object for the subclass, which isn't likely what was intended.

Further Reading