Skip to content

Commit 31af606

Browse files
committed
Address SpotBugs Medium:
org.apache.commons.io.input.ReadAheadInputStream.waitForAsyncReadComplete() does not release lock on all exception paths [org.apache.commons.io.input.ReadAheadInputStream] At ReadAheadInputStream.java:[line 448] UL_UNRELEASED_LOCK_EXCEPTION_PATH
1 parent a6b9c68 commit 31af606

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,11 @@ private void waitForAsyncReadComplete() throws IOException {
458458
iio.initCause(e);
459459
throw iio;
460460
} finally {
461-
isWaiting.set(false);
462-
stateChangeLock.unlock();
461+
try {
462+
isWaiting.set(false);
463+
} finally {
464+
stateChangeLock.unlock();
465+
}
463466
}
464467
checkReadException();
465468
}

0 commit comments

Comments
 (0)