From 122c02d7c5a84927ef197aed67e2134bd7abb05c Mon Sep 17 00:00:00 2001 From: cpovirk Date: Thu, 7 Mar 2024 17:46:59 -0800 Subject: [PATCH] Migrate from soon-to-be-deprecated `propagateIfPossible` to equivalent `throwIfInstanceOf` and `throwIfUnchecked` calls. PiperOrigin-RevId: 613760381 --- .../google/caliper/runner/options/CommandLineParser.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/caliper-runner/src/main/java/com/google/caliper/runner/options/CommandLineParser.java b/caliper-runner/src/main/java/com/google/caliper/runner/options/CommandLineParser.java index 2ac13836..c33d9ce2 100644 --- a/caliper-runner/src/main/java/com/google/caliper/runner/options/CommandLineParser.java +++ b/caliper-runner/src/main/java/com/google/caliper/runner/options/CommandLineParser.java @@ -15,12 +15,13 @@ package com.google.caliper.runner.options; import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Throwables.throwIfInstanceOf; +import static com.google.common.base.Throwables.throwIfUnchecked; import com.google.caliper.util.DisplayUsageException; import com.google.caliper.util.InvalidCommandException; import com.google.caliper.util.Parser; import com.google.caliper.util.Parsers; -import com.google.common.base.Throwables; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterators; @@ -445,7 +446,8 @@ private static void invokeMethod(Object injectee, Method method, Object value) throw new AssertionError(impossible); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); - Throwables.propagateIfPossible(cause, InvalidCommandException.class); + throwIfInstanceOf(cause, InvalidCommandException.class); + throwIfUnchecked(cause); throw new RuntimeException(e); } }