diff --git a/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java b/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java index 35aa1943e1..c31f36eb6c 100644 --- a/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java +++ b/main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java @@ -17,8 +17,6 @@ import java.util.concurrent.Future; import java.util.concurrent.ThreadPoolExecutor; -import org.cryptomator.common.UncheckedInterruptedException; - /** * Executes long-running computations and returns the result strictly in order of the job submissions, no matter how long each job takes. * @@ -45,12 +43,8 @@ public FifoParallelDataProcessor(int numThreads, int workAhead) { * @throws InterruptedException */ void submit(Callable processingJob) throws InterruptedException { - try { - Future future = executorService.submit(processingJob); - processedData.put(future); - } catch (UncheckedInterruptedException e) { - throw e.getCause(); - } + Future future = executorService.submit(processingJob); + processedData.put(future); } /** diff --git a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessorTest.java b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessorTest.java index 045cbe950d..652fe479ad 100644 --- a/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessorTest.java +++ b/main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessorTest.java @@ -32,6 +32,19 @@ public void testRethrowsException() throws InterruptedException { processor.processedData(); } + @Test(expected = RuntimeException.class) + public void testRethrowsCheckedExceptionAsRuntimeExceptions() throws InterruptedException { + FifoParallelDataProcessor processor = new FifoParallelDataProcessor<>(1, 1); + try { + processor.submit(() -> { + throw new Exception("will be wrapped in a RuntimeException during 'processedData()'"); + }); + } catch (Exception e) { + Assert.fail("Exception must not yet be thrown."); + } + processor.processedData(); + } + @Test(expected = RejectedExecutionException.class) public void testRejectExecutionAfterShutdown() throws InterruptedException, ReflectiveOperationException, SecurityException { FifoParallelDataProcessor processor = new FifoParallelDataProcessor<>(1, 1);