From 763ef2b911e8dc45be8d71c10279451b1147d306 Mon Sep 17 00:00:00 2001 From: aquilescanta Date: Mon, 10 May 2021 17:15:26 +0100 Subject: [PATCH] Avoid type-ambiguous overloads in ExoPlaybackExceptionTest PiperOrigin-RevId: 372942778 --- .../android/exoplayer2/ExoPlaybackExceptionTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/library/common/src/test/java/com/google/android/exoplayer2/ExoPlaybackExceptionTest.java b/library/common/src/test/java/com/google/android/exoplayer2/ExoPlaybackExceptionTest.java index 1721ce807a..86d9aefb13 100644 --- a/library/common/src/test/java/com/google/android/exoplayer2/ExoPlaybackExceptionTest.java +++ b/library/common/src/test/java/com/google/android/exoplayer2/ExoPlaybackExceptionTest.java @@ -31,7 +31,7 @@ public class ExoPlaybackExceptionTest { public void roundTripViaBundle_ofExoPlaybackExceptionTypeRemote_yieldsEqualInstance() { ExoPlaybackException before = ExoPlaybackException.createForRemote(/* message= */ "test"); ExoPlaybackException after = ExoPlaybackException.CREATOR.fromBundle(before.toBundle()); - assertThat(areEqual(before, after)).isTrue(); + assertThat(areExoPlaybackExceptionsEqual(before, after)).isTrue(); } @Test @@ -46,7 +46,7 @@ public class ExoPlaybackExceptionTest { /* isRecoverable= */ true); ExoPlaybackException after = ExoPlaybackException.CREATOR.fromBundle(before.toBundle()); - assertThat(areEqual(before, after)).isTrue(); + assertThat(areExoPlaybackExceptionsEqual(before, after)).isTrue(); } @Test @@ -61,7 +61,8 @@ public class ExoPlaybackExceptionTest { assertThat(after.getCause()).hasMessageThat().isEqualTo(before.getCause().getMessage()); } - private static boolean areEqual(ExoPlaybackException a, ExoPlaybackException b) { + private static boolean areExoPlaybackExceptionsEqual( + ExoPlaybackException a, ExoPlaybackException b) { if (a == null || b == null) { return a == b; } @@ -73,10 +74,10 @@ public class ExoPlaybackExceptionTest { && a.rendererFormatSupport == b.rendererFormatSupport && a.timestampMs == b.timestampMs && a.isRecoverable == b.isRecoverable - && areEqual(a.getCause(), b.getCause()); + && areThrowablesEqual(a.getCause(), b.getCause()); } - private static boolean areEqual(Throwable a, Throwable b) { + private static boolean areThrowablesEqual(Throwable a, Throwable b) { if (a == null || b == null) { return a == b; }