Skip to content

Commit d2dc677

Browse files
committed
[java] Reset thread interruption status before throwing
1 parent e140e22 commit d2dc677

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

java/client/src/org/openqa/selenium/os/CommandLine.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public void waitFor() {
120120
try {
121121
process.waitFor();
122122
} catch (InterruptedException e) {
123+
Thread.currentThread().interrupt();
123124
throw new WebDriverException(e);
124125
}
125126
}
@@ -128,6 +129,7 @@ public void waitFor(long timeout) {
128129
try {
129130
process.waitFor(timeout);
130131
} catch (InterruptedException e) {
132+
Thread.currentThread().interrupt();
131133
throw new WebDriverException(e);
132134
}
133135
}

java/client/src/org/openqa/selenium/os/OsProcess.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ private void waitForProcessStarted() {
239239
try {
240240
Thread.sleep(50);
241241
} catch (InterruptedException e) {
242+
Thread.currentThread().interrupt();
242243
throw new WebDriverException(e);
243244
}
244245
}
@@ -250,6 +251,7 @@ private void waitForTerminationAfterDestroy(int duration, TimeUnit unit) {
250251
try {
251252
Thread.sleep(50);
252253
} catch (InterruptedException e) {
254+
Thread.currentThread().interrupt();
253255
throw new WebDriverException(e);
254256
}
255257
}
@@ -260,7 +262,7 @@ private void destroyHarder() {
260262
Process awaitFor = this.process.destroyForcibly();
261263
awaitFor.waitFor(10, SECONDS);
262264
} catch (InterruptedException e) {
263-
Thread.interrupted();
265+
Thread.currentThread().interrupt();
264266
throw new RuntimeException(e);
265267
}
266268
}

0 commit comments

Comments
 (0)