Skip to content

Commit

Permalink
Use sneakyThrow in one more place.
Browse files Browse the repository at this point in the history
I missed this in cl/710111747.

RELNOTES=n/a
PiperOrigin-RevId: 710711439
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Dec 30, 2024
1 parent e828a1e commit 48ef5de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/main/java/com/google/common/truth/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Suppliers.memoize;
import static com.google.common.base.Throwables.throwIfUnchecked;
import static com.google.common.truth.DiffUtils.generateUnifiedDiff;
import static com.google.common.truth.Fact.fact;
import static com.google.common.truth.SneakyThrows.sneakyThrow;
Expand Down Expand Up @@ -307,10 +306,10 @@ static boolean kotlinRangeContains(Iterable<?> haystack, @Nullable Object needle
if (e.getCause() instanceof ClassCastException) {
// icky but no worse than what we normally do for isIn(Iterable)
return false;
// TODO(cpovirk): Should we also look for NullPointerException?
}
throwIfUnchecked(e.getCause());
// That method has no `throws` clause.
throw newLinkageError(e.getCause());
throw sneakyThrow(e.getCause());
} catch (IllegalAccessException e) {
// We're calling a public method on a public class.
throw newLinkageError(e);
Expand Down

0 comments on commit 48ef5de

Please sign in to comment.