Commit c7af1e12 by tonihei Committed by Oliver Woodman

Fix nullness warnings.

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

PiperOrigin-RevId: 348650535
parent dd7b379d
...@@ -38,6 +38,7 @@ import com.google.android.exoplayer2.util.Assertions; ...@@ -38,6 +38,7 @@ import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.AtomicFile; import com.google.android.exoplayer2.util.AtomicFile;
import com.google.android.exoplayer2.util.ReusableBufferedOutputStream; import com.google.android.exoplayer2.util.ReusableBufferedOutputStream;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import com.google.common.collect.ImmutableSet;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -301,9 +302,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -301,9 +302,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** Removes all resources whose {@link CachedContent CachedContents} are empty and unlocked. */ /** Removes all resources whose {@link CachedContent CachedContents} are empty and unlocked. */
public void removeEmpty() { public void removeEmpty() {
String[] keys = new String[keyToContent.size()]; // Create a copy of the keys as the underlying map is modified by maybeRemove(key).
keyToContent.keySet().toArray(keys); for (String key : ImmutableSet.copyOf(keyToContent.keySet())) {
for (String key : keys) {
maybeRemove(key); maybeRemove(key);
} }
} }
......
...@@ -409,7 +409,7 @@ public final class VideoFrameReleaseHelper { ...@@ -409,7 +409,7 @@ public final class VideoFrameReleaseHelper {
private final Handler handler; private final Handler handler;
private final HandlerThread choreographerOwnerThread; private final HandlerThread choreographerOwnerThread;
@MonotonicNonNull private Choreographer choreographer; private @MonotonicNonNull Choreographer choreographer;
private int observerCount; private int observerCount;
public static VSyncSampler getInstance() { public static VSyncSampler getInstance() {
......
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