You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/11/27 01:47:34 UTC
[groovy] 02/02: GROOVY-9826: Better propagation of
InterruptedException (additional case)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit ee8deb2870177542732f40ace75c4e6ec1adc0b0
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Nov 27 11:47:12 2020 +1000
GROOVY-9826: Better propagation of InterruptedException (additional case)
---
src/main/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java b/src/main/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
index 032fd3d..eaab539 100644
--- a/src/main/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
+++ b/src/main/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java
@@ -276,7 +276,7 @@ public class DefaultGroovyStaticMethods {
final int MAXTRIES = 3;
int accessDeniedCounter = 0;
File tempFile = null;
- for (int i = 0; i < MAXTRIES; i++) {
+ for (int i = 0; i < MAXTRIES && interrupted = null; i++) {
try {
tempFile = File.createTempFile(prefix, suffix);
tempFile.delete();
@@ -287,7 +287,8 @@ public class DefaultGroovyStaticMethods {
accessDeniedCounter++;
try {
Thread.sleep(100);
- } catch (InterruptedException ignore) {
+ } catch (InterruptedException ie) {
+ throw new RuntimeException(ie);
}
}
if (i == MAXTRIES - 1) {