Commit c529a0b9 by tonihei Committed by Ian Baker

Rollback of https://github.com/google/ExoPlayer/commit/31430f1ac50db80cf618f3e2ee9de2e9159f2e4c

*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

***

PiperOrigin-RevId: 343100646
parent 6d7997e7
Showing with 13 additions and 124 deletions
...@@ -103,8 +103,6 @@ public final class AudioCapabilities { ...@@ -103,8 +103,6 @@ public final class AudioCapabilities {
* supported. * supported.
* @param maxChannelCount The maximum number of audio channels that can be played simultaneously. * @param maxChannelCount The maximum number of audio channels that can be played simultaneously.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public AudioCapabilities(@Nullable int[] supportedEncodings, int maxChannelCount) { public AudioCapabilities(@Nullable int[] supportedEncodings, int maxChannelCount) {
if (supportedEncodings != null) { if (supportedEncodings != null) {
this.supportedEncodings = Arrays.copyOf(supportedEncodings, supportedEncodings.length); this.supportedEncodings = Arrays.copyOf(supportedEncodings, supportedEncodings.length);
......
...@@ -288,8 +288,6 @@ public interface AudioSink { ...@@ -288,8 +288,6 @@ public interface AudioSink {
* is applied the audio data will have {@code outputChannels.length} channels. * is applied the audio data will have {@code outputChannels.length} channels.
* @throws ConfigurationException If an error occurs configuring the sink. * @throws ConfigurationException If an error occurs configuring the sink.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels) void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels)
throws ConfigurationException; throws ConfigurationException;
......
...@@ -26,14 +26,8 @@ import java.nio.ByteBuffer; ...@@ -26,14 +26,8 @@ import java.nio.ByteBuffer;
*/ */
/* package */ final class ChannelMappingAudioProcessor extends BaseAudioProcessor { /* package */ final class ChannelMappingAudioProcessor extends BaseAudioProcessor {
// nullness annotations are not applicable to primitive types @Nullable private int[] pendingOutputChannels;
@SuppressWarnings("nullness:nullness.on.primitive") @Nullable private int[] outputChannels;
@Nullable
private int[] pendingOutputChannels;
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private int[] outputChannels;
/** /**
* Resets the channel mapping. After calling this method, call {@link #configure(AudioFormat)} to * Resets the channel mapping. After calling this method, call {@link #configure(AudioFormat)} to
...@@ -43,8 +37,6 @@ import java.nio.ByteBuffer; ...@@ -43,8 +37,6 @@ import java.nio.ByteBuffer;
* leave the input unchanged. * leave the input unchanged.
* @see AudioSink#configure(com.google.android.exoplayer2.Format, int, int[]) * @see AudioSink#configure(com.google.android.exoplayer2.Format, int, int[])
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public void setChannelMap(@Nullable int[] outputChannels) { public void setChannelMap(@Nullable int[] outputChannels) {
pendingOutputChannels = outputChannels; pendingOutputChannels = outputChannels;
} }
...@@ -52,10 +44,7 @@ import java.nio.ByteBuffer; ...@@ -52,10 +44,7 @@ import java.nio.ByteBuffer;
@Override @Override
public AudioFormat onConfigure(AudioFormat inputAudioFormat) public AudioFormat onConfigure(AudioFormat inputAudioFormat)
throws UnhandledAudioFormatException { throws UnhandledAudioFormatException {
// nullness annotations are not applicable to primitive types @Nullable int[] outputChannels = pendingOutputChannels;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
int[] outputChannels = pendingOutputChannels;
if (outputChannels == null) { if (outputChannels == null) {
return AudioFormat.NOT_SET; return AudioFormat.NOT_SET;
} }
......
...@@ -50,8 +50,6 @@ public class ForwardingAudioSink implements AudioSink { ...@@ -50,8 +50,6 @@ public class ForwardingAudioSink implements AudioSink {
return sink.getCurrentPositionUs(sourceEnded); return sink.getCurrentPositionUs(sourceEnded);
} }
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Override @Override
public void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels) public void configure(Format inputFormat, int specifiedBufferSize, @Nullable int[] outputChannels)
throws ConfigurationException { throws ConfigurationException {
......
...@@ -335,8 +335,6 @@ class AsynchronousMediaCodecBufferEnqueuer { ...@@ -335,8 +335,6 @@ class AsynchronousMediaCodecBufferEnqueuer {
* @param dst The destination array, which will be reused if it's at least as long as {@code src}. * @param dst The destination array, which will be reused if it's at least as long as {@code src}.
* @return The copy, which may be {@code dst} if it was reused. * @return The copy, which may be {@code dst} if it was reused.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
private static int[] copy(@Nullable int[] src, @Nullable int[] dst) { private static int[] copy(@Nullable int[] src, @Nullable int[] dst) {
if (src == null) { if (src == null) {
...@@ -358,8 +356,6 @@ class AsynchronousMediaCodecBufferEnqueuer { ...@@ -358,8 +356,6 @@ class AsynchronousMediaCodecBufferEnqueuer {
* @param dst The destination array, which will be reused if it's at least as long as {@code src}. * @param dst The destination array, which will be reused if it's at least as long as {@code src}.
* @return The copy, which may be {@code dst} if it was reused. * @return The copy, which may be {@code dst} if it was reused.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
private static byte[] copy(@Nullable byte[] src, @Nullable byte[] dst) { private static byte[] copy(@Nullable byte[] src, @Nullable byte[] dst) {
if (src == null) { if (src == null) {
......
...@@ -59,8 +59,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -59,8 +59,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Nullable @Nullable
private MediaFormat pendingOutputFormat; private MediaFormat pendingOutputFormat;
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@GuardedBy("lock") @GuardedBy("lock")
@Nullable @Nullable
private MediaCodec.CodecException mediaCodecException; private MediaCodec.CodecException mediaCodecException;
...@@ -214,8 +212,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -214,8 +212,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Override @Override
public void onOutputBufferAvailable( public void onOutputBufferAvailable(
@NonNull MediaCodec codec, int index, @NonNull MediaCodec.BufferInfo info) { @NonNull MediaCodec codec, int index, @NonNull MediaCodec.BufferInfo info) {
...@@ -229,8 +225,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -229,8 +225,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Override @Override
public void onError(@NonNull MediaCodec codec, @NonNull MediaCodec.CodecException e) { public void onError(@NonNull MediaCodec codec, @NonNull MediaCodec.CodecException e) {
synchronized (lock) { synchronized (lock) {
......
...@@ -935,10 +935,7 @@ public final class MediaCodecUtil { ...@@ -935,10 +935,7 @@ public final class MediaCodecUtil {
private final int codecKind; private final int codecKind;
// nullness annotations are not applicable to outer types @Nullable private android.media.MediaCodecInfo[] mediaCodecInfos;
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable
private android.media.MediaCodecInfo[] mediaCodecInfos;
public MediaCodecListCompatV21(boolean includeSecure, boolean includeTunneling) { public MediaCodecListCompatV21(boolean includeSecure, boolean includeTunneling) {
codecKind = codecKind =
......
...@@ -85,8 +85,6 @@ public final class MediaFormatUtil { ...@@ -85,8 +85,6 @@ public final class MediaFormatUtil {
* @param key The key to set. * @param key The key to set.
* @param value The byte array that will be wrapped to obtain the value. * @param value The byte array that will be wrapped to obtain the value.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public static void maybeSetByteBuffer(MediaFormat format, String key, @Nullable byte[] value) { public static void maybeSetByteBuffer(MediaFormat format, String key, @Nullable byte[] value) {
if (value != null) { if (value != null) {
format.setByteBuffer(key, ByteBuffer.wrap(value)); format.setByteBuffer(key, ByteBuffer.wrap(value));
......
...@@ -104,10 +104,7 @@ import java.util.List; ...@@ -104,10 +104,7 @@ import java.util.List;
boolean isRemoveAction = input.readBoolean(); boolean isRemoveAction = input.readBoolean();
int dataLength = input.readInt(); int dataLength = input.readInt();
// nullness annotations are not applicable to primitive types @Nullable byte[] data;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
byte[] data;
if (dataLength != 0) { if (dataLength != 0) {
data = new byte[dataLength]; data = new byte[dataLength];
input.readFully(data); input.readFully(data);
......
...@@ -345,8 +345,6 @@ public final class DownloadHelper { ...@@ -345,8 +345,6 @@ public final class DownloadHelper {
* SmoothStreaming media items. * SmoothStreaming media items.
* @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams. * @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public static DownloadHelper forMediaItem( public static DownloadHelper forMediaItem(
Context context, Context context,
MediaItem mediaItem, MediaItem mediaItem,
...@@ -376,8 +374,6 @@ public final class DownloadHelper { ...@@ -376,8 +374,6 @@ public final class DownloadHelper {
* SmoothStreaming media items. * SmoothStreaming media items.
* @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams. * @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public static DownloadHelper forMediaItem( public static DownloadHelper forMediaItem(
MediaItem mediaItem, MediaItem mediaItem,
DefaultTrackSelector.Parameters trackSelectorParameters, DefaultTrackSelector.Parameters trackSelectorParameters,
...@@ -409,8 +405,6 @@ public final class DownloadHelper { ...@@ -409,8 +405,6 @@ public final class DownloadHelper {
* SmoothStreaming media items. * SmoothStreaming media items.
* @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams. * @throws IllegalArgumentException If the {@code dataSourceFactory} is null for adaptive streams.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public static DownloadHelper forMediaItem( public static DownloadHelper forMediaItem(
MediaItem mediaItem, MediaItem mediaItem,
DefaultTrackSelector.Parameters trackSelectorParameters, DefaultTrackSelector.Parameters trackSelectorParameters,
...@@ -730,8 +724,6 @@ public final class DownloadHelper { ...@@ -730,8 +724,6 @@ public final class DownloadHelper {
* @param data Application provided data to store in {@link DownloadRequest#data}. * @param data Application provided data to store in {@link DownloadRequest#data}.
* @return The built {@link DownloadRequest}. * @return The built {@link DownloadRequest}.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DownloadRequest getDownloadRequest(@Nullable byte[] data) { public DownloadRequest getDownloadRequest(@Nullable byte[] data) {
return getDownloadRequest(playbackProperties.uri.toString(), data); return getDownloadRequest(playbackProperties.uri.toString(), data);
} }
...@@ -744,8 +736,6 @@ public final class DownloadHelper { ...@@ -744,8 +736,6 @@ public final class DownloadHelper {
* @param data Application provided data to store in {@link DownloadRequest#data}. * @param data Application provided data to store in {@link DownloadRequest#data}.
* @return The built {@link DownloadRequest}. * @return The built {@link DownloadRequest}.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DownloadRequest getDownloadRequest(String id, @Nullable byte[] data) { public DownloadRequest getDownloadRequest(String id, @Nullable byte[] data) {
DownloadRequest.Builder requestBuilder = DownloadRequest.Builder requestBuilder =
new DownloadRequest.Builder(id, playbackProperties.uri) new DownloadRequest.Builder(id, playbackProperties.uri)
......
...@@ -44,16 +44,9 @@ public final class DownloadRequest implements Parcelable { ...@@ -44,16 +44,9 @@ public final class DownloadRequest implements Parcelable {
private final Uri uri; private final Uri uri;
@Nullable private String mimeType; @Nullable private String mimeType;
@Nullable private List<StreamKey> streamKeys; @Nullable private List<StreamKey> streamKeys;
// nullness annotations are not applicable to primitive types @Nullable private byte[] keySetId;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private byte[] keySetId;
@Nullable private String customCacheKey; @Nullable private String customCacheKey;
// nullness annotations are not applicable to primitive types @Nullable private byte[] data;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private byte[] data;
/** Creates a new instance with the specified id and uri. */ /** Creates a new instance with the specified id and uri. */
public Builder(String id, Uri uri) { public Builder(String id, Uri uri) {
...@@ -74,8 +67,6 @@ public final class DownloadRequest implements Parcelable { ...@@ -74,8 +67,6 @@ public final class DownloadRequest implements Parcelable {
} }
/** Sets the {@link DownloadRequest#keySetId}. */ /** Sets the {@link DownloadRequest#keySetId}. */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public Builder setKeySetId(@Nullable byte[] keySetId) { public Builder setKeySetId(@Nullable byte[] keySetId) {
this.keySetId = keySetId; this.keySetId = keySetId;
return this; return this;
...@@ -88,8 +79,6 @@ public final class DownloadRequest implements Parcelable { ...@@ -88,8 +79,6 @@ public final class DownloadRequest implements Parcelable {
} }
/** Sets the {@link DownloadRequest#data}. */ /** Sets the {@link DownloadRequest#data}. */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public Builder setData(@Nullable byte[] data) { public Builder setData(@Nullable byte[] data) {
this.data = data; this.data = data;
return this; return this;
...@@ -120,10 +109,7 @@ public final class DownloadRequest implements Parcelable { ...@@ -120,10 +109,7 @@ public final class DownloadRequest implements Parcelable {
/** Stream keys to be downloaded. If empty, all streams will be downloaded. */ /** Stream keys to be downloaded. If empty, all streams will be downloaded. */
public final List<StreamKey> streamKeys; public final List<StreamKey> streamKeys;
/** The key set id of the offline licence if the content is protected with DRM. */ /** The key set id of the offline licence if the content is protected with DRM. */
// nullness annotations are not applicable to primitive types @Nullable public final byte[] keySetId;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
public final byte[] keySetId;
/** /**
* Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming * Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming
* downloads. * downloads.
...@@ -140,8 +126,6 @@ public final class DownloadRequest implements Parcelable { ...@@ -140,8 +126,6 @@ public final class DownloadRequest implements Parcelable {
* @param customCacheKey See {@link #customCacheKey}. * @param customCacheKey See {@link #customCacheKey}.
* @param data See {@link #data}. * @param data See {@link #data}.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
private DownloadRequest( private DownloadRequest(
String id, String id,
Uri uri, Uri uri,
...@@ -197,8 +181,6 @@ public final class DownloadRequest implements Parcelable { ...@@ -197,8 +181,6 @@ public final class DownloadRequest implements Parcelable {
* @param keySetId The key set ID of the copy. * @param keySetId The key set ID of the copy.
* @return The copy with the specified key set ID. * @return The copy with the specified key set ID.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DownloadRequest copyWithKeySetId(@Nullable byte[] keySetId) { public DownloadRequest copyWithKeySetId(@Nullable byte[] keySetId) {
return new DownloadRequest(id, uri, mimeType, streamKeys, keySetId, customCacheKey, data); return new DownloadRequest(id, uri, mimeType, streamKeys, keySetId, customCacheKey, data);
} }
......
...@@ -114,8 +114,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S ...@@ -114,8 +114,6 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
* @param mediaSourceEventDispatcher A dispatcher to notify of {@link MediaSourceEventListener} * @param mediaSourceEventDispatcher A dispatcher to notify of {@link MediaSourceEventListener}
* events. * events.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public ChunkSampleStream( public ChunkSampleStream(
int primaryTrackType, int primaryTrackType,
@Nullable int[] embeddedTrackTypes, @Nullable int[] embeddedTrackTypes,
......
...@@ -45,8 +45,6 @@ public abstract class DataChunk extends Chunk { ...@@ -45,8 +45,6 @@ public abstract class DataChunk extends Chunk {
* @param trackSelectionData See {@link #trackSelectionData}. * @param trackSelectionData See {@link #trackSelectionData}.
* @param data An optional recycled array that can be used as a holder for the data. * @param data An optional recycled array that can be used as a holder for the data.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public DataChunk( public DataChunk(
DataSource dataSource, DataSource dataSource,
DataSpec dataSpec, DataSpec dataSpec,
......
...@@ -138,10 +138,7 @@ public final class MediaParserChunkExtractor implements ChunkExtractor { ...@@ -138,10 +138,7 @@ public final class MediaParserChunkExtractor implements ChunkExtractor {
// Internal methods. // Internal methods.
private void maybeExecutePendingSeek() { private void maybeExecutePendingSeek() {
// nullness annotations are not applicable to outer types @Nullable MediaParser.SeekMap dummySeekMap = outputConsumerAdapter.getDummySeekMap();
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable
MediaParser.SeekMap dummySeekMap = outputConsumerAdapter.getDummySeekMap();
if (pendingSeekUs != C.TIME_UNSET && dummySeekMap != null) { if (pendingSeekUs != C.TIME_UNSET && dummySeekMap != null) {
mediaParser.seek(dummySeekMap.getSeekPoints(pendingSeekUs).first); mediaParser.seek(dummySeekMap.getSeekPoints(pendingSeekUs).first);
pendingSeekUs = C.TIME_UNSET; pendingSeekUs = C.TIME_UNSET;
......
...@@ -55,8 +55,6 @@ public final class ByteArrayDataSink implements DataSink { ...@@ -55,8 +55,6 @@ public final class ByteArrayDataSink implements DataSink {
* Returns the data written to the sink since the last call to {@link #open(DataSpec)}, or null if * Returns the data written to the sink since the last call to {@link #open(DataSpec)}, or null if
* {@link #open(DataSpec)} has never been called. * {@link #open(DataSpec)} has never been called.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] getData() { public byte[] getData() {
return stream == null ? null : stream.toByteArray(); return stream == null ? null : stream.toByteArray();
......
...@@ -34,11 +34,7 @@ public final class DataSchemeDataSource extends BaseDataSource { ...@@ -34,11 +34,7 @@ public final class DataSchemeDataSource extends BaseDataSource {
public static final String SCHEME_DATA = "data"; public static final String SCHEME_DATA = "data";
@Nullable private DataSpec dataSpec; @Nullable private DataSpec dataSpec;
// nullness annotations are not applicable to primitive types @Nullable private byte[] data;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private byte[] data;
private int endPosition; private int endPosition;
private int readPosition; private int readPosition;
......
...@@ -32,11 +32,7 @@ public final class DefaultAllocator implements Allocator { ...@@ -32,11 +32,7 @@ public final class DefaultAllocator implements Allocator {
private final boolean trimOnReset; private final boolean trimOnReset;
private final int individualAllocationSize; private final int individualAllocationSize;
// nullness annotations are not applicable to primitive types @Nullable private final byte[] initialAllocationBlock;
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
private final byte[] initialAllocationBlock;
private final Allocation[] singleAllocationReleaseHolder; private final Allocation[] singleAllocationReleaseHolder;
private int targetBufferSize; private int targetBufferSize;
......
...@@ -334,11 +334,7 @@ public final class Loader implements LoaderErrorThrower { ...@@ -334,11 +334,7 @@ public final class Loader implements LoaderErrorThrower {
private final T loadable; private final T loadable;
private final long startTimeMs; private final long startTimeMs;
// nullness annotations are not applicable to outer types @Nullable private Loader.Callback<T> callback;
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable
private Loader.Callback<T> callback;
@Nullable private IOException currentError; @Nullable private IOException currentError;
private int errorCount; private int errorCount;
......
...@@ -45,8 +45,6 @@ import java.util.Map; ...@@ -45,8 +45,6 @@ import java.util.Map;
* Returns the {@code encryptionKey} cached against this {@code uri}, or null if {@code uri} is * Returns the {@code encryptionKey} cached against this {@code uri}, or null if {@code uri} is
* null or not present in the cache. * null or not present in the cache.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] get(@Nullable Uri uri) { public byte[] get(@Nullable Uri uri) {
if (uri == null) { if (uri == null) {
...@@ -60,8 +58,6 @@ import java.util.Map; ...@@ -60,8 +58,6 @@ import java.util.Map;
* *
* @throws NullPointerException if {@code uri} or {@code encryptionKey} are null. * @throws NullPointerException if {@code uri} or {@code encryptionKey} are null.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] put(Uri uri, byte[] encryptionKey) { public byte[] put(Uri uri, byte[] encryptionKey) {
return backingMap.put(Assertions.checkNotNull(uri), Assertions.checkNotNull(encryptionKey)); return backingMap.put(Assertions.checkNotNull(uri), Assertions.checkNotNull(encryptionKey));
...@@ -82,8 +78,6 @@ import java.util.Map; ...@@ -82,8 +78,6 @@ import java.util.Map;
* *
* @throws NullPointerException if {@code uri} is null. * @throws NullPointerException if {@code uri} is null.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] remove(Uri uri) { public byte[] remove(Uri uri) {
return backingMap.remove(Assertions.checkNotNull(uri)); return backingMap.remove(Assertions.checkNotNull(uri));
......
...@@ -669,10 +669,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -669,10 +669,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
return null; return null;
} }
// nullness annotations are not applicable to primitive types @Nullable byte[] encryptionKey = keyCache.remove(keyUri);
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable
byte[] encryptionKey = keyCache.remove(keyUri);
if (encryptionKey != null) { if (encryptionKey != null) {
// The key was present in the key cache. We re-insert it to prevent it from being evicted by // The key was present in the key cache. We re-insert it to prevent it from being evicted by
// the following key addition. Note that removal of the key is necessary to affect the // the following key addition. Note that removal of the key is necessary to affect the
...@@ -691,8 +688,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -691,8 +688,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
scratchSpace); scratchSpace);
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Nullable @Nullable
private static Uri getFullEncryptionKeyUri( private static Uri getFullEncryptionKeyUri(
HlsMediaPlaylist playlist, @Nullable HlsMediaPlaylist.SegmentBase segmentBase) { HlsMediaPlaylist playlist, @Nullable HlsMediaPlaylist.SegmentBase segmentBase) {
...@@ -796,8 +791,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -796,8 +791,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
} }
/** Return the result of this chunk, or null if loading is not complete. */ /** Return the result of this chunk, or null if loading is not complete. */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
public byte[] getResult() { public byte[] getResult() {
return result; return result;
......
...@@ -73,8 +73,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -73,8 +73,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* @param initSegmentKey The initialization segment decryption key, if fully encrypted. Null * @param initSegmentKey The initialization segment decryption key, if fully encrypted. Null
* otherwise. * otherwise.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
public static HlsMediaChunk createInstance( public static HlsMediaChunk createInstance(
HlsExtractorFactory extractorFactory, HlsExtractorFactory extractorFactory,
DataSource dataSource, DataSource dataSource,
...@@ -99,8 +97,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -99,8 +97,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
mediaSegment.byteRangeOffset, mediaSegment.byteRangeOffset,
mediaSegment.byteRangeLength); mediaSegment.byteRangeLength);
boolean mediaSegmentEncrypted = mediaSegmentKey != null; boolean mediaSegmentEncrypted = mediaSegmentKey != null;
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
byte[] mediaSegmentIv = byte[] mediaSegmentIv =
mediaSegmentEncrypted mediaSegmentEncrypted
...@@ -115,8 +111,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -115,8 +111,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Nullable DataSource initDataSource = null; @Nullable DataSource initDataSource = null;
if (initSegment != null) { if (initSegment != null) {
initSegmentEncrypted = initSegmentKey != null; initSegmentEncrypted = initSegmentKey != null;
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Nullable @Nullable
byte[] initSegmentIv = byte[] initSegmentIv =
initSegmentEncrypted initSegmentEncrypted
...@@ -542,8 +536,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -542,8 +536,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* *
* <p>{@code fullSegmentEncryptionKey} & {@code encryptionIv} can either both be null, or neither. * <p>{@code fullSegmentEncryptionKey} & {@code encryptionIv} can either both be null, or neither.
*/ */
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
private static DataSource buildDataSource( private static DataSource buildDataSource(
DataSource dataSource, DataSource dataSource,
@Nullable byte[] fullSegmentEncryptionKey, @Nullable byte[] fullSegmentEncryptionKey,
......
...@@ -211,8 +211,6 @@ public final class HlsMediaSource extends BaseMediaSource ...@@ -211,8 +211,6 @@ public final class HlsMediaSource extends BaseMediaSource
* @param playlistTrackerFactory A factory for {@link HlsPlaylistTracker} instances. * @param playlistTrackerFactory A factory for {@link HlsPlaylistTracker} instances.
* @return This factory, for convenience. * @return This factory, for convenience.
*/ */
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
public Factory setPlaylistTrackerFactory( public Factory setPlaylistTrackerFactory(
@Nullable HlsPlaylistTracker.Factory playlistTrackerFactory) { @Nullable HlsPlaylistTracker.Factory playlistTrackerFactory) {
this.playlistTrackerFactory = this.playlistTrackerFactory =
...@@ -297,8 +295,6 @@ public final class HlsMediaSource extends BaseMediaSource ...@@ -297,8 +295,6 @@ public final class HlsMediaSource extends BaseMediaSource
return this; return this;
} }
// nullness annotations are not applicable to outer types
@SuppressWarnings("nullness:nullness.on.outer")
@Override @Override
public Factory setDrmHttpDataSourceFactory( public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) { @Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
......
...@@ -255,8 +255,6 @@ public final class MediaParserHlsMediaChunkExtractor implements HlsMediaChunkExt ...@@ -255,8 +255,6 @@ public final class MediaParserHlsMediaChunkExtractor implements HlsMediaChunkExt
this.extractorInput = extractorInput; this.extractorInput = extractorInput;
} }
// nullness annotations are not applicable to primitive types
@SuppressWarnings("nullness:nullness.on.primitive")
@Override @Override
public int read(@NonNull byte[] buffer, int offset, int readLength) throws IOException { public int read(@NonNull byte[] buffer, int offset, int readLength) throws IOException {
int peekedBytes = extractorInput.peek(buffer, offset, readLength); int peekedBytes = extractorInput.peek(buffer, offset, readLength);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment