From b48ca6e0403ac07063d7767352fc4cd77295f91c Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 30 Aug 2022 17:07:31 +0000 Subject: [PATCH] Fix 19 ErrorProneStyle findings: * Non-standard parameter comment; prefer `/* paramName= */ arg` (see http://go/bugpattern/ParameterComment) (19 times) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL looks good? Just LGTM and Approve it! This CL doesn’t look good? This is what you can do: * Revert this CL, by replying "REVERT: " * File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content. * File a bug under go/rosie-bug if there's an issue with how the CL was managed. * Revert this CL and not get a CL that cleans up these paths in the future by replying "BLOCKLIST: ". This is not reversible! We recommend to opt out the respective paths in your CL Robot configuration instead: go/clrobot-opt-out. This CL was generated by CL Robot - a tool that cleans up code findings (go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA. Anything wrong with the signup? File a bug at go/clrobot-bug. #codehealth Tested: Local presubmit tests passed. PiperOrigin-RevId: 471022923 --- .../media3/exoplayer/ExoPlayerTest.java | 34 +++++++++---------- .../exoplayer/MediaPeriodQueueTest.java | 2 +- .../media3/exoplayer/MediaSourceListTest.java | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java index 328dc7caf2..fcb19b48ca 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java @@ -1232,10 +1232,10 @@ public final class ExoPlayerTest { new ActionSchedule.Builder(TAG) .pause() .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .executeRunnable(() -> mediaSource.setNewSourceInfo(timeline2)) .waitForTimelineChanged( - timeline2, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline2, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .play() .build(); ExoPlayerTestRunner testRunner = @@ -1758,7 +1758,7 @@ public final class ExoPlayerTest { .playUntilPosition(/* mediaItemIndex= */ 0, /* positionMs= */ 2000) .setMediaSources(/* mediaItemIndex= */ 0, /* positionMs= */ 2000, secondSource) .waitForTimelineChanged( - secondTimeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + secondTimeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .executeRunnable( new PlayerRunnable() { @Override @@ -1812,7 +1812,7 @@ public final class ExoPlayerTest { .playUntilPosition(/* mediaItemIndex= */ 0, /* positionMs= */ 2000) .setMediaSources(/* resetPosition= */ true, secondSource) .waitForTimelineChanged( - secondTimeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + secondTimeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .executeRunnable( new PlayerRunnable() { @Override @@ -1869,7 +1869,7 @@ public final class ExoPlayerTest { .playUntilPosition(/* mediaItemIndex= */ 0, /* positionMs= */ 2000) .setMediaSources(secondSource) .waitForTimelineChanged( - secondTimeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + secondTimeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .executeRunnable( new PlayerRunnable() { @Override @@ -2306,7 +2306,7 @@ public final class ExoPlayerTest { new ActionSchedule.Builder(TAG) .pause() .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .sendMessage(target, /* positionMs= */ 50) .play() .build(); @@ -2495,7 +2495,7 @@ public final class ExoPlayerTest { .waitForPlaybackState(Player.STATE_BUFFERING) .sendMessage(target, /* positionMs= */ 50) .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .seek(/* positionMs= */ 50) .build(); new ExoPlayerTestRunner.Builder(context) @@ -2535,7 +2535,7 @@ public final class ExoPlayerTest { .pause() .sendMessage(target, /* positionMs= */ 50) .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .seek(/* positionMs= */ 51) .play() .build(); @@ -2612,11 +2612,11 @@ public final class ExoPlayerTest { new ActionSchedule.Builder(TAG) .pause() .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .sendMessage(target, /* positionMs= */ 50) .executeRunnable(() -> mediaSource.setNewSourceInfo(secondTimeline)) .waitForTimelineChanged( - secondTimeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + secondTimeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .play() .build(); new ExoPlayerTestRunner.Builder(context) @@ -2658,7 +2658,7 @@ public final class ExoPlayerTest { new ActionSchedule.Builder(TAG) .pause() .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .sendMessage(target, /* mediaItemIndex = */ 2, /* positionMs= */ 50) .play() .build(); @@ -2689,11 +2689,11 @@ public final class ExoPlayerTest { new ActionSchedule.Builder(TAG) .pause() .waitForTimelineChanged( - timeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .sendMessage(target, /* mediaItemIndex = */ 1, /* positionMs= */ 50) .executeRunnable(() -> mediaSource.setNewSourceInfo(secondTimeline)) .waitForTimelineChanged( - secondTimeline, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + secondTimeline, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .seek(/* mediaItemIndex= */ 0, /* positionMs= */ 0) .play() .build(); @@ -2903,7 +2903,7 @@ public final class ExoPlayerTest { /* positionMs= */ Util.usToMs(TimelineWindowDefinition.DEFAULT_WINDOW_DURATION_US)) .executeRunnable(() -> mediaSource.setNewSourceInfo(timeline2)) .waitForTimelineChanged( - timeline2, /* expectedReason */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) + timeline2, /* expectedReason= */ Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE) .play() .build(); ExoPlayerTestRunner testRunner = @@ -9378,7 +9378,7 @@ public final class ExoPlayerTest { Player.Commands defaultCommands = createWithDefaultCommands(); Player.Commands commandsWithSeekToNextWindow = createWithDefaultCommands(COMMAND_SEEK_TO_NEXT_MEDIA_ITEM, COMMAND_SEEK_TO_NEXT); - Player.Commands emptyTimelineCommands = createWithDefaultCommands(/* isTimelineEmpty */ true); + Player.Commands emptyTimelineCommands = createWithDefaultCommands(/* isTimelineEmpty= */ true); Player.Listener mockListener = mock(Player.Listener.class); ExoPlayer player = new TestExoPlayerBuilder(context).build(); player.addListener(mockListener); @@ -9406,7 +9406,7 @@ public final class ExoPlayerTest { Player.Commands defaultCommands = createWithDefaultCommands(); Player.Commands commandsWithSeekToPreviousWindow = createWithDefaultCommands(COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM); - Player.Commands emptyTimelineCommands = createWithDefaultCommands(/* isTimelineEmpty */ true); + Player.Commands emptyTimelineCommands = createWithDefaultCommands(/* isTimelineEmpty= */ true); Player.Listener mockListener = mock(Player.Listener.class); ExoPlayer player = new TestExoPlayerBuilder(context).build(); player.addListener(mockListener); @@ -10099,7 +10099,7 @@ public final class ExoPlayerTest { // Verify test setup (now = 20 seconds in live window, default start position = 20 seconds). assertThat(liveOffsetAtStart).isIn(Range.closed(-100L, 100L)); - player.setPlaybackParameters(new PlaybackParameters(/* speed */ 2.0f)); + player.setPlaybackParameters(new PlaybackParameters(/* speed= */ 2.0f)); // Play until close to the end of the available live window. TestPlayerRunHelper.playUntilPosition( player, /* mediaItemIndex= */ 0, /* positionMs= */ 999_000); diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaPeriodQueueTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaPeriodQueueTest.java index cb059bc241..c11a0f616a 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaPeriodQueueTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaPeriodQueueTest.java @@ -1087,7 +1087,7 @@ public final class MediaPeriodQueueTest { mediaSourceList.setMediaSources( ImmutableList.of(mediaSourceHolder), new FakeShuffleOrder(/* length= */ 1)); mediaSourceHolder.mediaSource.prepareSource( - mock(MediaSourceCaller.class), /* mediaTransferListener */ null, PlayerId.UNSET); + mock(MediaSourceCaller.class), /* mediaTransferListener= */ null, PlayerId.UNSET); Timeline playlistTimeline = mediaSourceList.createTimeline(); firstPeriodUid = playlistTimeline.getUidOfPeriod(/* periodIndex= */ 0); diff --git a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaSourceListTest.java b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaSourceListTest.java index 42a65f24d7..edb874091c 100644 --- a/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaSourceListTest.java +++ b/libraries/exoplayer/src/test/java/androidx/media3/exoplayer/MediaSourceListTest.java @@ -374,7 +374,7 @@ public class MediaSourceListTest { mockMediaSource2, mockMediaSource3, mockMediaSource4); - mediaSourceList.prepare(/* mediaTransferListener */ null); + mediaSourceList.prepare(/* mediaTransferListener= */ null); mediaSourceList.addMediaSources(/* index= */ 0, holders, shuffleOrder); mediaSourceList.removeMediaSourceRange(/* fromIndex= */ 1, /* toIndex= */ 3, shuffleOrder);