Skip to content

Commit

Permalink
Avoid a compiler warning
Browse files Browse the repository at this point in the history
Updated a try block used so that it references a lock variable
acquired via try-with-resources.  This helps avoid a compiler
warning.
  • Loading branch information
dirmgr committed Oct 4, 2021
1 parent 8f7513a commit dcafd9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/unboundid/util/Debug.java
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,10 @@ public static synchronized void debugToFile(@NotNull final File file,
{
try (FileLock fileLock = fileChannel.lock())
{
// We need to reference the fileLock variable inside the try block to
// avoid a compiler warning.
Validator.ensureTrue(fileLock.isValid());

final ByteStringBuffer messageBuffer = new ByteStringBuffer();

if (fileChannel.size() > 0L)
Expand Down

0 comments on commit dcafd9f

Please sign in to comment.