Cleanup: Remove unnecessary generic types

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205409290
This commit is contained in:
olly 2018-07-20 09:35:30 -07:00 committed by Oliver Woodman
parent 7551d98087
commit d2eb3fbefa
28 changed files with 58 additions and 55 deletions

View File

@ -32,8 +32,7 @@ import java.util.Map;
/* package */ final class CastTimeline extends Timeline {
public static final CastTimeline EMPTY_CAST_TIMELINE =
new CastTimeline(
Collections.<MediaQueueItem>emptyList(), Collections.<String, Long>emptyMap());
new CastTimeline(Collections.emptyList(), Collections.emptyMap());
private final SparseIntArray idsToIndex;
private final int[] ids;

View File

@ -175,7 +175,7 @@ public abstract class TimelineQueueNavigator implements MediaSessionConnector.Qu
private void publishFloatingQueueWindow(Player player) {
if (player.getCurrentTimeline().isEmpty()) {
mediaSession.setQueue(Collections.<MediaSessionCompat.QueueItem>emptyList());
mediaSession.setQueue(Collections.emptyList());
activeQueueItemId = MediaSessionCompat.QueueItem.UNKNOWN_ID;
return;
}

View File

@ -935,8 +935,8 @@ public final class Format implements Parcelable {
this.language = language;
this.accessibilityChannel = accessibilityChannel;
this.subsampleOffsetUs = subsampleOffsetUs;
this.initializationData = initializationData == null ? Collections.<byte[]>emptyList()
: initializationData;
this.initializationData =
initializationData == null ? Collections.emptyList() : initializationData;
this.drmInitData = drmInitData;
this.metadata = metadata;
}

View File

@ -193,8 +193,7 @@ public final class FragmentedMp4Extractor implements Extractor {
@Nullable TimestampAdjuster timestampAdjuster,
@Nullable Track sideloadedTrack,
@Nullable DrmInitData sideloadedDrmInitData) {
this(flags, timestampAdjuster, sideloadedTrack, sideloadedDrmInitData,
Collections.<Format>emptyList());
this(flags, timestampAdjuster, sideloadedTrack, sideloadedDrmInitData, Collections.emptyList());
}
/**

View File

@ -77,8 +77,10 @@ public interface TsPayloadReader {
byte[] descriptorBytes) {
this.streamType = streamType;
this.language = language;
this.dvbSubtitleInfos = dvbSubtitleInfos == null ? Collections.<DvbSubtitleInfo>emptyList()
: Collections.unmodifiableList(dvbSubtitleInfos);
this.dvbSubtitleInfos =
dvbSubtitleInfos == null
? Collections.emptyList()
: Collections.unmodifiableList(dvbSubtitleInfos);
this.descriptorBytes = descriptorBytes;
}

View File

@ -38,7 +38,7 @@ public interface MediaCodecSelector {
List<MediaCodecInfo> decoderInfos =
MediaCodecUtil.getDecoderInfos(format.sampleMimeType, requiresSecureDecoder);
return decoderInfos.isEmpty()
? Collections.<MediaCodecInfo>emptyList()
? Collections.emptyList()
: Collections.singletonList(decoderInfos.get(0));
}

View File

@ -531,7 +531,7 @@ public class ConcatenatingMediaSource extends CompositeMediaSource<MediaSourceHo
listenerNotificationScheduled = false;
List<Runnable> actionsOnCompletion =
pendingOnCompletionActions.isEmpty()
? Collections.<Runnable>emptyList()
? Collections.emptyList()
: new ArrayList<>(pendingOnCompletionActions);
pendingOnCompletionActions.clear();
refreshSourceInfo(

View File

@ -308,7 +308,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
}
private void clearOutput() {
updateOutput(Collections.<Cue>emptyList());
updateOutput(Collections.emptyList());
}
@SuppressWarnings("unchecked")

View File

@ -743,7 +743,7 @@ public final class Cea708Decoder extends CeaDecoder {
}
}
Collections.sort(displayCues);
return Collections.<Cue>unmodifiableList(displayCues);
return Collections.unmodifiableList(displayCues);
}
private void resetCueBuilders() {

View File

@ -54,7 +54,7 @@ import java.util.List;
@Override
public List<Cue> getCues(long timeUs) {
return timeUs >= 0 ? cues : Collections.<Cue>emptyList();
return timeUs >= 0 ? cues : Collections.emptyList();
}
}

View File

@ -37,8 +37,8 @@ import java.util.Map;
Map<String, TtmlRegion> regionMap) {
this.root = root;
this.regionMap = regionMap;
this.globalStyles = globalStyles != null
? Collections.unmodifiableMap(globalStyles) : Collections.<String, TtmlStyle>emptyMap();
this.globalStyles =
globalStyles != null ? Collections.unmodifiableMap(globalStyles) : Collections.emptyMap();
this.eventTimesUs = root.getEventTimesUs();
}

View File

@ -57,7 +57,7 @@ import java.util.List;
@Override
public List<Cue> getCues(long timeUs) {
return timeUs >= 0 ? cues : Collections.<Cue>emptyList();
return timeUs >= 0 ? cues : Collections.emptyList();
}
}

View File

@ -85,8 +85,7 @@ public final class Mp4WebvttDecoder extends SimpleSubtitleDecoder {
if (boxType == TYPE_sttg) {
WebvttCueParser.parseCueSettingsList(boxPayload, builder);
} else if (boxType == TYPE_payl) {
WebvttCueParser.parseCueText(null, boxPayload.trim(), builder,
Collections.<WebvttCssStyle>emptyList());
WebvttCueParser.parseCueText(null, boxPayload.trim(), builder, Collections.emptyList());
} else {
// Other VTTCueBox children are still not supported and are ignored.
}

View File

@ -51,6 +51,6 @@ import java.util.List;
@Override
public List<Cue> getCues(long timeUs) {
return timeUs >= 0 ? cues : Collections.<Cue>emptyList();
return timeUs >= 0 ? cues : Collections.emptyList();
}
}

View File

@ -34,7 +34,7 @@ public final class DefaultContentMetadata implements ContentMetadata {
/** An empty DefaultContentMetadata. */
public static final DefaultContentMetadata EMPTY =
new DefaultContentMetadata(Collections.<String, byte[]>emptyMap());
new DefaultContentMetadata(Collections.emptyMap());
private static final int MAX_VALUE_LENGTH = 10 * 1024 * 1024;
private int hashCode;

View File

@ -33,13 +33,13 @@ public final class FragmentedMp4ExtractorTest {
@Test
public void testSample() throws Exception {
ExtractorAsserts.assertBehavior(
getExtractorFactory(Collections.<Format>emptyList()), "mp4/sample_fragmented.mp4");
getExtractorFactory(Collections.emptyList()), "mp4/sample_fragmented.mp4");
}
@Test
public void testSampleSeekable() throws Exception {
ExtractorAsserts.assertBehavior(
getExtractorFactory(Collections.<Format>emptyList()), "mp4/sample_fragmented_seekable.mp4");
getExtractorFactory(Collections.emptyList()), "mp4/sample_fragmented_seekable.mp4");
}
@Test

View File

@ -55,7 +55,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeNoSubtitle() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(RuntimeEnvironment.application, NO_SUBTITLE);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
assertThat(subtitle.getCues(0)).isEmpty();
@ -63,7 +63,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeJustText() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_JUST_TEXT);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
SpannedString text = new SpannedString(subtitle.getCues(0).get(0).text);
@ -74,7 +74,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeWithStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_WITH_STYL);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
SpannedString text = new SpannedString(subtitle.getCues(0).get(0).text);
@ -90,7 +90,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeWithStylAllDefaults() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_WITH_STYL_ALL_DEFAULTS);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
@ -102,7 +102,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeUtf16BeNoStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_UTF16_BE_NO_STYL);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
SpannedString text = new SpannedString(subtitle.getCues(0).get(0).text);
@ -113,7 +113,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeUtf16LeNoStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_UTF16_LE_NO_STYL);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
SpannedString text = new SpannedString(subtitle.getCues(0).get(0).text);
@ -124,7 +124,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeWithMultipleStyl() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes = TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_WITH_MULTIPLE_STYL);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);
SpannedString text = new SpannedString(subtitle.getCues(0).get(0).text);
@ -142,7 +142,7 @@ public final class Tx3gDecoderTest {
@Test
public void testDecodeWithOtherExtension() throws IOException, SubtitleDecoderException {
Tx3gDecoder decoder = new Tx3gDecoder(Collections.<byte[]>emptyList());
Tx3gDecoder decoder = new Tx3gDecoder(Collections.emptyList());
byte[] bytes =
TestUtil.getByteArray(RuntimeEnvironment.application, SAMPLE_WITH_OTHER_EXTENSION);
Subtitle subtitle = decoder.decode(bytes, bytes.length, false);

View File

@ -246,7 +246,7 @@ public final class WebvttCueParserTest {
private static Spanned parseCueText(String string) {
WebvttCue.Builder builder = new WebvttCue.Builder();
WebvttCueParser.parseCueText(null, string, builder, Collections.<WebvttCssStyle>emptyList());
WebvttCueParser.parseCueText(null, string, builder, Collections.emptyList());
return (Spanned) builder.build().text;
}

View File

@ -38,8 +38,7 @@ public class WebvttSubtitleTest {
private static final String FIRST_AND_SECOND_SUBTITLE_STRING =
FIRST_SUBTITLE_STRING + "\n" + SECOND_SUBTITLE_STRING;
private static final WebvttSubtitle emptySubtitle = new WebvttSubtitle(
Collections.<WebvttCue>emptyList());
private static final WebvttSubtitle emptySubtitle = new WebvttSubtitle(Collections.emptyList());
private static final WebvttSubtitle simpleSubtitle;
static {

View File

@ -69,12 +69,14 @@ public class AdaptationSet {
this.id = id;
this.type = type;
this.representations = Collections.unmodifiableList(representations);
this.accessibilityDescriptors = accessibilityDescriptors == null
? Collections.<Descriptor>emptyList()
: Collections.unmodifiableList(accessibilityDescriptors);
this.supplementalProperties = supplementalProperties == null
? Collections.<Descriptor>emptyList()
: Collections.unmodifiableList(supplementalProperties);
this.accessibilityDescriptors =
accessibilityDescriptors == null
? Collections.emptyList()
: Collections.unmodifiableList(accessibilityDescriptors);
this.supplementalProperties =
supplementalProperties == null
? Collections.emptyList()
: Collections.unmodifiableList(supplementalProperties);
}
}

View File

@ -102,7 +102,7 @@ public class DashManifest implements FilterableManifest<DashManifest> {
this.publishTimeMs = publishTimeMs;
this.utcTiming = utcTiming;
this.location = location;
this.periods = periods == null ? Collections.<Period>emptyList() : periods;
this.periods = periods == null ? Collections.emptyList() : periods;
}
public final int getPeriodCount() {

View File

@ -51,7 +51,7 @@ public class Period {
* @param adaptationSets The adaptation sets belonging to the period.
*/
public Period(@Nullable String id, long startMs, List<AdaptationSet> adaptationSets) {
this(id, startMs, adaptationSets, Collections.<EventStream>emptyList());
this(id, startMs, adaptationSets, Collections.emptyList());
}
/**

View File

@ -135,8 +135,10 @@ public abstract class Representation {
this.revisionId = revisionId;
this.format = format;
this.baseUrl = baseUrl;
this.inbandEventStreams = inbandEventStreams == null ? Collections.<Descriptor>emptyList()
: Collections.unmodifiableList(inbandEventStreams);
this.inbandEventStreams =
inbandEventStreams == null
? Collections.emptyList()
: Collections.unmodifiableList(inbandEventStreams);
initializationUri = segmentBase.getInitialization(this);
presentationTimeOffsetUs = segmentBase.getPresentationTimeOffsetUs();
}

View File

@ -83,8 +83,13 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
} else if (lastPathSegment.endsWith(MP4_FILE_EXTENSION)
|| lastPathSegment.startsWith(M4_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 4)
|| lastPathSegment.startsWith(MP4_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 5)) {
extractor = new FragmentedMp4Extractor(0, timestampAdjuster, null, drmInitData,
muxedCaptionFormats != null ? muxedCaptionFormats : Collections.<Format>emptyList());
extractor =
new FragmentedMp4Extractor(
0,
timestampAdjuster,
null,
drmInitData,
muxedCaptionFormats != null ? muxedCaptionFormats : Collections.emptyList());
} else {
// For any other file extension, we assume TS format.
@DefaultTsPayloadReaderFactory.Flags

View File

@ -368,7 +368,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
C.TRACK_TYPE_AUDIO,
new HlsUrl[] {audioRendition},
null,
Collections.<Format>emptyList(),
Collections.emptyList(),
positionUs);
sampleStreamWrappers[currentWrapperIndex++] = sampleStreamWrapper;
Format renditionFormat = audioRendition.format;
@ -385,11 +385,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
HlsUrl url = subtitleRenditions.get(i);
HlsSampleStreamWrapper sampleStreamWrapper =
buildSampleStreamWrapper(
C.TRACK_TYPE_TEXT,
new HlsUrl[] {url},
null,
Collections.<Format>emptyList(),
positionUs);
C.TRACK_TYPE_TEXT, new HlsUrl[] {url}, null, Collections.emptyList(), positionUs);
sampleStreamWrappers[currentWrapperIndex++] = sampleStreamWrapper;
sampleStreamWrapper.prepareWithMasterPlaylistInfo(
new TrackGroupArray(new TrackGroup(url.format)), 0, TrackGroupArray.EMPTY);

View File

@ -151,7 +151,7 @@ public final class HlsMasterPlaylist extends HlsPlaylist {
List<HlsUrl> emptyList = Collections.emptyList();
return new HlsMasterPlaylist(
null,
Collections.<String>emptyList(),
Collections.emptyList(),
variant,
emptyList,
emptyList,

View File

@ -129,7 +129,7 @@ public class SsManifestTest {
768,
null,
formats,
Collections.<Long>emptyList(),
Collections.emptyList(),
0);
}

View File

@ -391,7 +391,7 @@ public class PlayerNotificationManager {
customActions =
customActionReceiver != null
? customActionReceiver.createCustomActions(context)
: Collections.<String, NotificationCompat.Action>emptyMap();
: Collections.emptyMap();
for (String action : customActions.keySet()) {
intentFilter.addAction(action);
}