Inspectopedia Help

Synchronization on non-final field

Reports synchronized statements where the lock expression is a non-final field.

Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object.

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Groovy, 241.16690

Last modified: 29 April 2024