'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.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 28, 2020 at 6:09 PM
Updated August 28, 2020 at 6:19 PM
Resolved August 28, 2020 at 6:19 PM