'Lock' should be locked in front of a 'try' block (instead of in to block).
Description
The IntelliJ inspection report insists on this. I can't immediately find a compelling reason. Someone suggested it helps with non-reentrant locks failing to acquire a lock.
In any case, IntelliJ warnings are usually a good indicator that things can be improved, and moving the 'lock' outside of the try statement is a quick fix.
The IntelliJ inspection report insists on this. I can't immediately find a compelling reason. Someone suggested it helps with non-reentrant locks failing to acquire a lock.
In any case, IntelliJ warnings are usually a good indicator that things can be improved, and moving the 'lock' outside of the try statement is a quick fix.