From 9c1a80082fbd83bea510256e24d83dc61eaa9090 Mon Sep 17 00:00:00 2001 From: jbibik Date: Thu, 18 May 2023 16:06:43 +0100 Subject: [PATCH] Use TestUtil.getPublicMethods instead of getDeclaredMethods JaCoCo introduces private synthetic methods (even on interfaces) which have to be skipped when checking that a 'forwarding' implementation does forward everything. Instead we can use the existing `getPublicMethods()` method which implicitly skips these (since they're private). PiperOrigin-RevId: 533130932 (cherry picked from commit 620b9e15403b5138e7b3f44194b10e5ae7f72a8c) --- .../test/java/androidx/media3/common/SimpleBasePlayerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common/src/test/java/androidx/media3/common/SimpleBasePlayerTest.java b/libraries/common/src/test/java/androidx/media3/common/SimpleBasePlayerTest.java index 7bf3a16dc8..5a108550d5 100644 --- a/libraries/common/src/test/java/androidx/media3/common/SimpleBasePlayerTest.java +++ b/libraries/common/src/test/java/androidx/media3/common/SimpleBasePlayerTest.java @@ -65,7 +65,7 @@ public class SimpleBasePlayerTest { @Test public void allPlayerInterfaceMethods_declaredFinal() throws Exception { - for (Method method : Player.class.getDeclaredMethods()) { + for (Method method : TestUtil.getPublicMethods(Player.class)) { assertThat( SimpleBasePlayer.class .getMethod(method.getName(), method.getParameterTypes())