Fix nullness warnings.

These two things were reported by the nullness checker as warnings.

PiperOrigin-RevId: 348650535
This commit is contained in:
tonihei 2020-12-22 17:54:16 +00:00 committed by Oliver Woodman
parent dd7b379dc0
commit c7af1e12de
2 changed files with 4 additions and 4 deletions

View file

@ -38,6 +38,7 @@ import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.AtomicFile;
import com.google.android.exoplayer2.util.ReusableBufferedOutputStream;
import com.google.android.exoplayer2.util.Util;
import com.google.common.collect.ImmutableSet;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -301,9 +302,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** Removes all resources whose {@link CachedContent CachedContents} are empty and unlocked. */
public void removeEmpty() {
String[] keys = new String[keyToContent.size()];
keyToContent.keySet().toArray(keys);
for (String key : keys) {
// Create a copy of the keys as the underlying map is modified by maybeRemove(key).
for (String key : ImmutableSet.copyOf(keyToContent.keySet())) {
maybeRemove(key);
}
}

View file

@ -409,7 +409,7 @@ public final class VideoFrameReleaseHelper {
private final Handler handler;
private final HandlerThread choreographerOwnerThread;
@MonotonicNonNull private Choreographer choreographer;
private @MonotonicNonNull Choreographer choreographer;
private int observerCount;
public static VSyncSampler getInstance() {