From 798d158d3258e7670adaa5da02834e994de04d44 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 16 Aug 2017 13:45:51 +0200 Subject: [PATCH] Make SmackFuture.getOrThrow() throw InterruptedException --- .../main/java/org/jivesoftware/smack/SmackFuture.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackFuture.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackFuture.java index 076a16d4c..62b90f23f 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackFuture.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackFuture.java @@ -106,14 +106,9 @@ public abstract class SmackFuture implements Future, return getOrThrowExecutionException(); } - public synchronized final V getOrThrow() throws E { + public synchronized final V getOrThrow() throws E, InterruptedException { while (result == null && exception == null && !cancelled) { - try { - wait(); - } - catch (InterruptedException e) { - throw new RuntimeException(e); - } + wait(); } if (exception != null) {