Code inspection: Inconsistent synchronization on field
Last modified: 11 February 2024tip
This code inspection warns you about fields being used both with and without locking, thus helping you detect potential problems with thread safety. Here is an example:
The inspection is not triggered on const fields and in private methods that have no synchronization inside but are always used from synchronized contexts.