Skip to content

Commit 82a97a5

Browse files
committed
ThrottledInputStream.throttle() now restores the current thread's
interrupt flag when catching InterruptedException.
1 parent a2f3ab9 commit 82a97a5

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The <action> type attribute can be add,update,fix,remove.
5555
<action type="fix" dev="ggregory" due-to="Gary Gregory">FileAlterationMonitor.stop(long) now restores the current thread's interrupt flag when catching InterruptedException.</action>
5656
<action type="fix" dev="ggregory" due-to="Gary Gregory">FileCleaningTracker now restores the current thread's interrupt flag when catching InterruptedException.</action>
5757
<action type="fix" dev="ggregory" due-to="Gary Gregory">ThreadMonitor.run() now restores the current thread's interrupt flag when catching InterruptedException.</action>
58+
<action type="fix" dev="ggregory" due-to="Gary Gregory">ThrottledInputStream.throttle() now restores the current thread's interrupt flag when catching InterruptedException.</action>
5859
<!-- ADD -->
5960
<action type="add" dev="ggregory" due-to="Gary Gregory, Piotr P. Karwasz">Add and use IOUtils.closeQuietlySuppress(Closeable, Throwable) #818.</action>
6061
<!-- UPDATE -->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ private void throttle() throws InterruptedIOException {
271271
try {
272272
TimeUnit.MILLISECONDS.sleep(sleepMillis);
273273
} catch (final InterruptedException e) {
274+
Thread.currentThread().interrupt();
274275
throw new InterruptedIOException("Thread aborted");
275276
}
276277
}

0 commit comments

Comments
 (0)