From 8108d9f76ec7a1d291f68a2e0a4ce85999246e4b Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Wed, 26 Jun 2019 14:50:23 +0200 Subject: [PATCH] do not ignore InterruptedException, re-interrupt method instead --- .../main/java/sonia/scm/schedule/CronThreadFactory.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java b/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java index f4f77d1c3e..6519f500fa 100644 --- a/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java +++ b/scm-webapp/src/main/java/sonia/scm/schedule/CronThreadFactory.java @@ -30,8 +30,11 @@ class CronThreadFactory implements ThreadFactory, AutoCloseable { ThreadContext.remove(); return new Thread(r, createName()); }).get(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException("failed to schedule runnable"); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + throw new IllegalStateException("failed to schedule runnable"); + } catch (ExecutionException ex) { + throw new IllegalStateException("failed to schedule runnable"); } }