diff --git a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/options/PipelineOptionsFactory.java b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/options/PipelineOptionsFactory.java index 4781d1c829df..60dbd3f6b453 100644 --- a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/options/PipelineOptionsFactory.java +++ b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/options/PipelineOptionsFactory.java @@ -602,7 +602,7 @@ static synchronized Registration validateWellForm COMBINED_CACHE.put(combinedPipelineOptionsInterfaces, new Registration(allProxyClass, propertyDescriptors)); } catch (IntrospectionException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } @@ -617,7 +617,7 @@ static synchronized Registration validateWellForm INTERFACE_CACHE.put(iface, new Registration(proxyClass, propertyDescriptors)); } catch (IntrospectionException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } @SuppressWarnings("unchecked") diff --git a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/runners/inprocess/InProcessCreate.java b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/runners/inprocess/InProcessCreate.java index 9023b7b2dc4b..36e5a31861bc 100644 --- a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/runners/inprocess/InProcessCreate.java +++ b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/runners/inprocess/InProcessCreate.java @@ -29,7 +29,6 @@ import com.google.cloud.dataflow.sdk.values.PInput; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Optional; -import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterators; import com.google.common.collect.PeekingIterator; @@ -75,7 +74,7 @@ public PCollection apply(PInput input) { try { source = new InMemorySource<>(original.getElements(), elementCoder); } catch (IOException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } PCollection result = input.getPipeline().apply(Read.from(source)); result.setCoder(elementCoder); diff --git a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/MutationDetectors.java b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/MutationDetectors.java index 412e3eb72520..7558a0e19ad1 100644 --- a/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/MutationDetectors.java +++ b/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/MutationDetectors.java @@ -18,7 +18,6 @@ import com.google.cloud.dataflow.sdk.coders.Coder; import com.google.cloud.dataflow.sdk.coders.CoderException; -import com.google.common.base.Throwables; import java.util.Arrays; import java.util.Objects; @@ -113,7 +112,7 @@ public void verifyUnmodified() { try { verifyUnmodifiedThrowingCheckedExceptions(); } catch (CoderException exn) { - Throwables.propagate(exn); + throw new RuntimeException(exn); } } diff --git a/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/testing/RestoreSystemProperties.java b/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/testing/RestoreSystemProperties.java index 03bc6a530c99..a89be3edd75e 100644 --- a/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/testing/RestoreSystemProperties.java +++ b/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/testing/RestoreSystemProperties.java @@ -16,8 +16,6 @@ package com.google.cloud.dataflow.sdk.testing; -import com.google.common.base.Throwables; - import org.junit.rules.ExternalResource; import org.junit.rules.TestRule; @@ -45,7 +43,7 @@ protected void after() { System.getProperties().clear(); System.getProperties().load(bais); } catch (IOException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } } diff --git a/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/util/GcsUtilTest.java b/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/util/GcsUtilTest.java index e7cd7d7c22c8..65fb83812606 100644 --- a/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/util/GcsUtilTest.java +++ b/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/util/GcsUtilTest.java @@ -52,7 +52,6 @@ import com.google.cloud.dataflow.sdk.util.gcsfs.GcsPath; import com.google.cloud.hadoop.gcsio.GoogleCloudStorageReadChannel; import com.google.cloud.hadoop.util.ClientRequestHelper; -import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import org.junit.Rule; @@ -141,20 +140,22 @@ public void testMultipleThreadsCanCompleteOutOfOrderWithDefaultThreadPool() thro for (int i = 0; i < numThreads; i++) { final int currentLatch = i; countDownLatches[i] = new CountDownLatch(1); - executorService.execute(new Runnable() { - @Override - public void run() { - // Wait for latch N and then release latch N - 1 - try { - countDownLatches[currentLatch].await(); - if (currentLatch > 0) { - countDownLatches[currentLatch - 1].countDown(); + executorService.execute( + new Runnable() { + @Override + public void run() { + // Wait for latch N and then release latch N - 1 + try { + countDownLatches[currentLatch].await(); + if (currentLatch > 0) { + countDownLatches[currentLatch - 1].countDown(); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); + } } - } catch (InterruptedException e) { - throw Throwables.propagate(e); - } - } - }); + }); } // Release the last latch starting the chain reaction.