diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java index a47ac0c573..7bb6a83add 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ClippingMediaPeriod.java @@ -39,11 +39,7 @@ public final class ClippingMediaPeriod implements MediaPeriod, MediaPeriod.Callb */ public final MediaPeriod mediaPeriod; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private MediaPeriod.Callback callback; - + @Nullable private MediaPeriod.Callback callback; private @NullableType ClippingSampleStream[] sampleStreams; private long pendingInitialDiscontinuityPositionUs; /* package */ long startUs; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java b/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java index 285aa3a67c..a04dbd215f 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.java @@ -253,8 +253,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory { return this; } - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Override public DefaultMediaSourceFactory setDrmHttpDataSourceFactory( @Nullable HttpDataSource.Factory drmHttpDataSourceFactory) { @@ -391,8 +389,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory { private MediaSource maybeWrapWithAdsMediaSource(MediaItem mediaItem, MediaSource mediaSource) { Assertions.checkNotNull(mediaItem.playbackProperties); - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Nullable MediaItem.AdsConfiguration adsConfiguration = mediaItem.playbackProperties.adsConfiguration; if (adsConfiguration == null) { diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java index d82b9b037c..38146c92b2 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ExtractorMediaSource.java @@ -172,8 +172,6 @@ public final class ExtractorMediaSource extends CompositeMediaSource { /** * @deprecated Use {@link ProgressiveMediaSource.Factory#setDrmHttpDataSourceFactory} instead. */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Deprecated @Override public MediaSourceFactory setDrmHttpDataSourceFactory( diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceDrmHelper.java b/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceDrmHelper.java index 414a72d34e..f4a7b89fc7 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceDrmHelper.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceDrmHelper.java @@ -34,11 +34,7 @@ import java.util.Map; /** A helper to create a {@link DrmSessionManager} from a {@link MediaItem}. */ public final class MediaSourceDrmHelper { - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private HttpDataSource.Factory drmHttpDataSourceFactory; - + @Nullable private HttpDataSource.Factory drmHttpDataSourceFactory; @Nullable private String userAgent; /** @@ -49,8 +45,6 @@ public final class MediaSourceDrmHelper { * @param drmHttpDataSourceFactory The HTTP data source factory or {@code null} to use {@link * DefaultHttpDataSourceFactory}. */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") public void setDrmHttpDataSourceFactory( @Nullable HttpDataSource.Factory drmHttpDataSourceFactory) { this.drmHttpDataSourceFactory = drmHttpDataSourceFactory; @@ -71,8 +65,6 @@ public final class MediaSourceDrmHelper { /** Creates a {@link DrmSessionManager} for the given media item. */ public DrmSessionManager create(MediaItem mediaItem) { Assertions.checkNotNull(mediaItem.playbackProperties); - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Nullable MediaItem.DrmConfiguration drmConfiguration = mediaItem.playbackProperties.drmConfiguration; if (drmConfiguration == null || Util.SDK_INT < 18) { diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceFactory.java b/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceFactory.java index d3dcf1ea3a..204220e334 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceFactory.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/MediaSourceFactory.java @@ -77,8 +77,6 @@ public interface MediaSourceFactory { * DefaultHttpDataSourceFactory}. * @return This factory, for convenience. */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") MediaSourceFactory setDrmHttpDataSourceFactory( @Nullable HttpDataSource.Factory drmHttpDataSourceFactory); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java index f4fa33ed27..19f09fde22 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaSource.java @@ -153,8 +153,6 @@ public final class ProgressiveMediaSource extends BaseMediaSource return this; } - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Override public Factory setDrmHttpDataSourceFactory( @Nullable HttpDataSource.Factory drmHttpDataSourceFactory) { diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaPeriod.java b/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaPeriod.java index 7241af85c7..352785d37d 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaPeriod.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaPeriod.java @@ -406,10 +406,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; private final StatsDataSource dataSource; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - private byte[] sampleData; + @Nullable private byte[] sampleData; public SourceLoadable(DataSpec dataSpec, DataSource dataSource) { this.loadTaskId = LoadEventInfo.getNewId(); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java index 5c4a9dddbe..c2bbdbb893 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java @@ -57,25 +57,14 @@ public final class CacheDataSource implements DataSource { private @MonotonicNonNull Cache cache; private DataSource.Factory cacheReadDataSourceFactory; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private DataSink.Factory cacheWriteDataSinkFactory; - + @Nullable private DataSink.Factory cacheWriteDataSinkFactory; private CacheKeyFactory cacheKeyFactory; private boolean cacheIsReadOnly; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private DataSource.Factory upstreamDataSourceFactory; - + @Nullable private DataSource.Factory upstreamDataSourceFactory; @Nullable private PriorityTaskManager upstreamPriorityTaskManager; private int upstreamPriority; @CacheDataSource.Flags private int flags; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private CacheDataSource.EventListener eventListener; + @Nullable private CacheDataSource.EventListener eventListener; public Factory() { cacheReadDataSourceFactory = new FileDataSource.Factory(); @@ -128,8 +117,6 @@ public final class CacheDataSource implements DataSource { * DataSinks} for writing data to the cache, or {@code null} to disable writing. * @return This factory. */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") public Factory setCacheWriteDataSinkFactory( @Nullable DataSink.Factory cacheWriteDataSinkFactory) { this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory; @@ -166,8 +153,6 @@ public final class CacheDataSource implements DataSource { * cache, or {@code null} to cause failure in the case of a cache miss. * @return This factory. */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") public Factory setUpstreamDataSourceFactory( @Nullable DataSource.Factory upstreamDataSourceFactory) { this.upstreamDataSourceFactory = upstreamDataSourceFactory; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSourceFactory.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSourceFactory.java index afc617b64b..2c51da8a8d 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSourceFactory.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSourceFactory.java @@ -28,15 +28,8 @@ public final class CacheDataSourceFactory implements DataSource.Factory { private final DataSource.Factory upstreamFactory; private final DataSource.Factory cacheReadDataSourceFactory; @CacheDataSource.Flags private final int flags; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private final DataSink.Factory cacheWriteDataSinkFactory; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - private final CacheDataSource.EventListener eventListener; - + @Nullable private final DataSink.Factory cacheWriteDataSinkFactory; + @Nullable private final CacheDataSource.EventListener eventListener; @Nullable private final CacheKeyFactory cacheKeyFactory; /** @@ -67,8 +60,6 @@ public final class CacheDataSourceFactory implements DataSource.Factory { * @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int, * CacheDataSource.EventListener) */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") public CacheDataSourceFactory( Cache cache, DataSource.Factory upstreamFactory, @@ -90,8 +81,6 @@ public final class CacheDataSourceFactory implements DataSource.Factory { * @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int, * CacheDataSource.EventListener, CacheKeyFactory) */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") public CacheDataSourceFactory( Cache cache, DataSource.Factory upstreamFactory, diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheWriter.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheWriter.java index ec18bd4e40..8ea2b4e280 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheWriter.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheWriter.java @@ -73,8 +73,6 @@ public final class CacheWriter { * writer should instantiate its own internal temporary buffer. * @param progressListener An optional progress listener. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") public CacheWriter( CacheDataSource dataSource, DataSpec dataSpec, diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedContentIndex.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedContentIndex.java index 8bf3320f00..850ac59f04 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedContentIndex.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedContentIndex.java @@ -153,8 +153,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; * enabled. This option is only useful for downgrading from database storage back to legacy * storage. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") public CachedContentIndex( @Nullable DatabaseProvider databaseProvider, @Nullable File legacyStorageDir, @@ -519,8 +517,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; private boolean changed; @Nullable private ReusableBufferedOutputStream bufferedOutputStream; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") public LegacyStorage(File file, @Nullable byte[] secretKey, boolean encrypt) { checkState(secretKey != null || !encrypt); @Nullable Cipher cipher = null; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/ContentMetadata.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/ContentMetadata.java index 8081420b02..26b6d83a43 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/ContentMetadata.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/ContentMetadata.java @@ -42,8 +42,6 @@ public interface ContentMetadata { * @param defaultValue Value to return if the metadata doesn't exist. * @return The metadata value. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") @Nullable byte[] get(String key, @Nullable byte[] defaultValue); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/DefaultContentMetadata.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/DefaultContentMetadata.java index 741fed9f11..706fa0d2c3 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/DefaultContentMetadata.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/DefaultContentMetadata.java @@ -63,15 +63,10 @@ public final class DefaultContentMetadata implements ContentMetadata { return metadata.entrySet(); } - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") @Override @Nullable public final byte[] get(String name, @Nullable byte[] defaultValue) { - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] bytes = metadata.get(name); + @Nullable byte[] bytes = metadata.get(name); if (bytes != null) { return Arrays.copyOf(bytes, bytes.length); } else { @@ -82,10 +77,7 @@ public final class DefaultContentMetadata implements ContentMetadata { @Override @Nullable public final String get(String name, @Nullable String defaultValue) { - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] bytes = metadata.get(name); + @Nullable byte[] bytes = metadata.get(name); if (bytes != null) { return new String(bytes, Charsets.UTF_8); } else { @@ -95,10 +87,7 @@ public final class DefaultContentMetadata implements ContentMetadata { @Override public final long get(String name, long defaultValue) { - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] bytes = metadata.get(name); + @Nullable byte[] bytes = metadata.get(name); if (bytes != null) { return ByteBuffer.wrap(bytes).getLong(); } else { @@ -140,10 +129,7 @@ public final class DefaultContentMetadata implements ContentMetadata { } for (Entry entry : first.entrySet()) { byte[] value = entry.getValue(); - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] otherValue = second.get(entry.getKey()); + @Nullable byte[] otherValue = second.get(entry.getKey()); if (!Arrays.equals(value, otherValue)) { return false; } diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java index 76bafb9c9a..58cb57f261 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java @@ -177,18 +177,9 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; */ @Nullable public static Metadata parseMdtaFromMeta(Atom.ContainerAtom meta) { - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom hdlrAtom = meta.getLeafAtomOfType(Atom.TYPE_hdlr); - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom keysAtom = meta.getLeafAtomOfType(Atom.TYPE_keys); - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom ilstAtom = meta.getLeafAtomOfType(Atom.TYPE_ilst); + @Nullable Atom.LeafAtom hdlrAtom = meta.getLeafAtomOfType(Atom.TYPE_hdlr); + @Nullable Atom.LeafAtom keysAtom = meta.getLeafAtomOfType(Atom.TYPE_keys); + @Nullable Atom.LeafAtom ilstAtom = meta.getLeafAtomOfType(Atom.TYPE_ilst); if (hdlrAtom == null || keysAtom == null || ilstAtom == null @@ -219,8 +210,6 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; int keyIndex = ilst.readInt() - 1; if (keyIndex >= 0 && keyIndex < keyNames.length) { String key = keyNames[keyIndex]; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Nullable Metadata.Entry entry = MetadataUtil.parseMdtaMetadataEntryFromIlst(ilst, atomPosition + atomSize, key); @@ -290,19 +279,10 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; mdhdData.second, drmInitData, isQuickTime); - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - long[] editListDurations = null; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - long[] editListMediaTimes = null; + @Nullable long[] editListDurations = null; + @Nullable long[] editListMediaTimes = null; if (!ignoreEditLists) { - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.ContainerAtom edtsAtom = trak.getContainerAtomOfType(Atom.TYPE_edts); + @Nullable Atom.ContainerAtom edtsAtom = trak.getContainerAtomOfType(Atom.TYPE_edts); if (edtsAtom != null) { @Nullable Pair edtsData = parseEdts(edtsAtom); if (edtsData != null) { @@ -330,17 +310,11 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; Track track, Atom.ContainerAtom stblAtom, GaplessInfoHolder gaplessInfoHolder) throws ParserException { SampleSizeBox sampleSizeBox; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom stszAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stsz); + @Nullable Atom.LeafAtom stszAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stsz); if (stszAtom != null) { sampleSizeBox = new StszSampleSizeBox(stszAtom); } else { - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom stz2Atom = stblAtom.getLeafAtomOfType(Atom.TYPE_stz2); + @Nullable Atom.LeafAtom stz2Atom = stblAtom.getLeafAtomOfType(Atom.TYPE_stz2); if (stz2Atom == null) { throw new ParserException("Track has no sample table size information"); } @@ -361,10 +335,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; // Entries are byte offsets of chunks. boolean chunkOffsetsAreLongs = false; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom chunkOffsetsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stco); + @Nullable Atom.LeafAtom chunkOffsetsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stco); if (chunkOffsetsAtom == null) { chunkOffsetsAreLongs = true; chunkOffsetsAtom = checkNotNull(stblAtom.getLeafAtomOfType(Atom.TYPE_co64)); @@ -375,16 +346,10 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; // Entries are (number of samples, timestamp delta between those samples). ParsableByteArray stts = checkNotNull(stblAtom.getLeafAtomOfType(Atom.TYPE_stts)).data; // Entries are the indices of samples that are synchronization samples. - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom stssAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stss); + @Nullable Atom.LeafAtom stssAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stss); @Nullable ParsableByteArray stss = stssAtom != null ? stssAtom.data : null; // Entries are (number of samples, timestamp offset). - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom cttsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_ctts); + @Nullable Atom.LeafAtom cttsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_ctts); @Nullable ParsableByteArray ctts = cttsAtom != null ? cttsAtom.data : null; // Prepare to read chunk information. @@ -728,10 +693,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; ilst.skipBytes(Atom.HEADER_SIZE); ArrayList entries = new ArrayList<>(); while (ilst.getPosition() < limit) { - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Metadata.Entry entry = MetadataUtil.parseIlstElement(ilst); + @Nullable Metadata.Entry entry = MetadataUtil.parseIlstElement(ilst); if (entry != null) { entries.add(entry); } @@ -1034,10 +996,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; @Nullable List initializationData = null; @Nullable String mimeType = null; @Nullable String codecs = null; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] projectionData = null; + @Nullable byte[] projectionData = null; @C.StereoMode int stereoMode = Format.NO_VALUE; while (childPosition - position < size) { @@ -1087,10 +1046,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; Pair<@NullableType String, byte @NullableType []> mimeTypeAndInitializationDataBytes = parseEsdsFromParent(parent, childStartPosition); mimeType = mimeTypeAndInitializationDataBytes.first; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] initializationDataBytes = mimeTypeAndInitializationDataBytes.second; + @Nullable byte[] initializationDataBytes = mimeTypeAndInitializationDataBytes.second; if (initializationDataBytes != null) { initializationData = ImmutableList.of(initializationDataBytes); } @@ -1167,10 +1123,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; */ @Nullable private static Pair parseEdts(Atom.ContainerAtom edtsAtom) { - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom elstAtom = edtsAtom.getLeafAtomOfType(Atom.TYPE_elst); + @Nullable Atom.LeafAtom elstAtom = edtsAtom.getLeafAtomOfType(Atom.TYPE_elst); if (elstAtom == null) { return null; } @@ -1320,10 +1273,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; Pair<@NullableType String, byte @NullableType []> mimeTypeAndInitializationData = parseEsdsFromParent(parent, esdsAtomPosition); mimeType = mimeTypeAndInitializationData.first; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] initializationDataBytes = mimeTypeAndInitializationData.second; + @Nullable byte[] initializationDataBytes = mimeTypeAndInitializationData.second; if (initializationDataBytes != null) { if (MimeTypes.AUDIO_AAC.equals(mimeType)) { // Update sampleRate and channelCount from the AudioSpecificConfig initialization @@ -1578,8 +1528,6 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; } /** Parses the proj box from sv3d box, as specified by https://github.com/google/spatial-media. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") @Nullable private static byte[] parseProjFromParent(ParsableByteArray parent, int position, int size) { int childPosition = position + Atom.HEADER_SIZE; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java index e052a672f6..32d3bc0677 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java @@ -1166,10 +1166,7 @@ public class FragmentedMp4Extractor implements Extractor { int perSampleIvSize = sgpd.readUnsignedByte(); byte[] keyId = new byte[16]; sgpd.readBytes(keyId, 0, keyId.length); - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - byte[] constantIv = null; + @Nullable byte[] constantIv = null; if (perSampleIvSize == 0) { int constantIvSize = sgpd.readUnsignedByte(); constantIv = new byte[constantIvSize]; @@ -1417,10 +1414,7 @@ public class FragmentedMp4Extractor implements Extractor { @C.BufferFlags int sampleFlags = trackBundle.getCurrentSampleFlags(); // Encryption data. - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - TrackOutput.CryptoData cryptoData = null; + @Nullable TrackOutput.CryptoData cryptoData = null; @Nullable TrackEncryptionBox encryptionBox = trackBundle.getEncryptionBoxIfEncrypted(); if (encryptionBox != null) { cryptoData = encryptionBox.cryptoData; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/MetadataUtil.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/MetadataUtil.java index 4305394a68..4a048f8b64 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/MetadataUtil.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/MetadataUtil.java @@ -341,8 +341,6 @@ import java.util.List; * @param ilst Holds the data to be parsed. * @return The parsed element, or null if the element's type was not recognized. */ - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") @Nullable public static Metadata.Entry parseIlstElement(ParsableByteArray ilst) { int position = ilst.getPosition(); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java index cc50347bea..2a6346fb87 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java @@ -464,10 +464,7 @@ public final class Mp4Extractor implements Extractor, SeekMap { @Nullable Metadata udtaMetadata = null; boolean isQuickTime = fileType == FILE_TYPE_QUICKTIME; GaplessInfoHolder gaplessInfoHolder = new GaplessInfoHolder(); - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.LeafAtom udta = moov.getLeafAtomOfType(Atom.TYPE_udta); + @Nullable Atom.LeafAtom udta = moov.getLeafAtomOfType(Atom.TYPE_udta); if (udta != null) { udtaMetadata = AtomParsers.parseUdta(udta, isQuickTime); if (udtaMetadata != null) { @@ -475,10 +472,7 @@ public final class Mp4Extractor implements Extractor, SeekMap { } } @Nullable Metadata mdtaMetadata = null; - // nullness annotations are not applicable to outer types - @SuppressWarnings("nullness:nullness.on.outer") - @Nullable - Atom.ContainerAtom meta = moov.getContainerAtomOfType(Atom.TYPE_meta); + @Nullable Atom.ContainerAtom meta = moov.getContainerAtomOfType(Atom.TYPE_meta); if (meta != null) { mdtaMetadata = AtomParsers.parseMdtaFromMeta(meta); } diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/PsshAtomUtil.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/PsshAtomUtil.java index 93df56daa6..b4f537f0ce 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/PsshAtomUtil.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/PsshAtomUtil.java @@ -37,8 +37,6 @@ public final class PsshAtomUtil { * @param data The scheme specific data. * @return The PSSH atom. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") public static byte[] buildPsshAtom(UUID systemId, @Nullable byte[] data) { return buildPsshAtom(systemId, null, data); } @@ -51,8 +49,6 @@ public final class PsshAtomUtil { * @param data The scheme specific data. * @return The PSSH atom. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") public static byte[] buildPsshAtom( UUID systemId, @Nullable UUID[] keyIds, @Nullable byte[] data) { int dataLength = data != null ? data.length : 0; @@ -136,8 +132,6 @@ public final class PsshAtomUtil { * @return The parsed scheme specific data. Null if the input is not a valid PSSH atom, or if the * PSSH atom has an unsupported version, or if the PSSH atom does not match the passed UUID. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") @Nullable public static byte[] parseSchemeSpecificData(byte[] atom, UUID uuid) { @Nullable PsshAtom parsedAtom = parsePsshAtom(atom); diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Track.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Track.java index 19bd1a32c0..7676926c4d 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Track.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/Track.java @@ -81,17 +81,15 @@ public final class Track { */ @Transformation public final int sampleTransformation; - /** Durations of edit list segments in the movie timescale. Null if there is no edit list. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - public final long[] editListDurations; + /** + * Durations of edit list segments in the movie timescale. Null if there is no edit list. + */ + @Nullable public final long[] editListDurations; - /** Media times for edit list segments in the track timescale. Null if there is no edit list. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - public final long[] editListMediaTimes; + /** + * Media times for edit list segments in the track timescale. Null if there is no edit list. + */ + @Nullable public final long[] editListMediaTimes; /** * For H264 video tracks, the length in bytes of the NALUnitLength field in each sample. 0 for @@ -101,20 +99,10 @@ public final class Track { @Nullable private final TrackEncryptionBox[] sampleDescriptionEncryptionBoxes; - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - public Track( - int id, - int type, - long timescale, - long movieTimescale, - long durationUs, - Format format, - @Transformation int sampleTransformation, - @Nullable TrackEncryptionBox[] sampleDescriptionEncryptionBoxes, - int nalUnitLengthFieldLength, - @Nullable long[] editListDurations, - @Nullable long[] editListMediaTimes) { + public Track(int id, int type, long timescale, long movieTimescale, long durationUs, + Format format, @Transformation int sampleTransformation, + @Nullable TrackEncryptionBox[] sampleDescriptionEncryptionBoxes, int nalUnitLengthFieldLength, + @Nullable long[] editListDurations, @Nullable long[] editListMediaTimes) { this.id = id; this.type = type; this.timescale = timescale; diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackEncryptionBox.java b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackEncryptionBox.java index 1ada137976..a35d211aa4 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackEncryptionBox.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackEncryptionBox.java @@ -52,10 +52,7 @@ public final class TrackEncryptionBox { * If {@link #perSampleIvSize} is 0, holds the default initialization vector as defined in the * track encryption box or sample group description box. Null otherwise. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") - @Nullable - public final byte[] defaultInitializationVector; + @Nullable public final byte[] defaultInitializationVector; /** * @param isEncrypted See {@link #isEncrypted}. @@ -66,8 +63,6 @@ public final class TrackEncryptionBox { * @param defaultClearBlocks See {@link TrackOutput.CryptoData#clearBlocks}. * @param defaultInitializationVector See {@link #defaultInitializationVector}. */ - // nullness annotations are not applicable to primitive types - @SuppressWarnings("nullness:nullness.on.primitive") public TrackEncryptionBox( boolean isEncrypted, @Nullable String schemeType,