Skip to content

Commit

Permalink
Add some missing Nullable annotations
Browse files Browse the repository at this point in the history
Also remove NonNull, since we assume NonNull by default. Except
where explicitly overriding a method with NonNull annotated args,
in which case we're still expected to use it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209758204
  • Loading branch information
ojw28 committed Aug 24, 2018
1 parent e2ebb78 commit 9ccbb5b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
Expand Up @@ -490,7 +490,7 @@ protected final MediaCodec getCodec() {
return codec;
}

protected final MediaCodecInfo getCodecInfo() {
protected final @Nullable MediaCodecInfo getCodecInfo() {
return codecInfo;
}

Expand Down
Expand Up @@ -19,6 +19,7 @@
import android.graphics.Point;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Pair;
Expand Down Expand Up @@ -2032,7 +2033,7 @@ public AudioTrackScore(Format format, Parameters parameters, int formatSupport)
* negative integer if this score is worse than the other.
*/
@Override
public int compareTo(AudioTrackScore other) {
public int compareTo(@NonNull AudioTrackScore other) {
if (this.withinRendererCapabilitiesScore != other.withinRendererCapabilitiesScore) {
return compareInts(this.withinRendererCapabilitiesScore,
other.withinRendererCapabilitiesScore);
Expand Down
Expand Up @@ -379,7 +379,7 @@ public void close() throws HttpDataSourceException {
*
* @return The current open connection, or null.
*/
protected final HttpURLConnection getConnection() {
protected final @Nullable HttpURLConnection getConnection() {
return connection;
}

Expand Down
Expand Up @@ -15,7 +15,6 @@
*/
package com.google.android.exoplayer2.upstream.cache;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -96,7 +95,6 @@ public CacheException(Throwable cause) {
* @param listener The listener to add.
* @return The current spans for the key.
*/
@NonNull
NavigableSet<CacheSpan> addListener(String key, Listener listener);

/**
Expand All @@ -113,7 +111,6 @@ public CacheException(Throwable cause) {
* @param key The key for which spans should be returned.
* @return The spans for the key.
*/
@NonNull
NavigableSet<CacheSpan> getCachedSpans(String key);

/**
Expand Down
Expand Up @@ -17,6 +17,7 @@

import android.os.ConditionVariable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.util.Assertions;
Expand Down Expand Up @@ -224,7 +225,7 @@ public synchronized SimpleCacheSpan startReadWrite(String key, long position)
}

@Override
public synchronized SimpleCacheSpan startReadWriteNonBlocking(String key, long position)
public synchronized @Nullable SimpleCacheSpan startReadWriteNonBlocking(String key, long position)
throws CacheException {
Assertions.checkState(!released);
SimpleCacheSpan cacheSpan = getSpan(key, position);
Expand Down
Expand Up @@ -155,7 +155,7 @@ public void removeListener(PlaylistEventListener listener) {
}

@Override
public HlsMasterPlaylist getMasterPlaylist() {
public @Nullable HlsMasterPlaylist getMasterPlaylist() {
return masterPlaylist;
}

Expand Down
Expand Up @@ -597,7 +597,7 @@ public void setUseArtwork(boolean useArtwork) {
}

/** Returns the default artwork to display. */
public Drawable getDefaultArtwork() {
public @Nullable Drawable getDefaultArtwork() {
return defaultArtwork;
}

Expand Down

0 comments on commit 9ccbb5b

Please sign in to comment.