Remove WebvttCue from null-checking blacklist

PiperOrigin-RevId: 277910909
This commit is contained in:
ibaker 2019-11-01 12:36:23 +00:00 committed by Oliver Woodman
parent ab2bfcc1b9
commit b972fd1f27

View File

@ -21,6 +21,7 @@ import android.text.Layout.Alignment;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.text.Cue; import com.google.android.exoplayer2.text.Cue;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Log; import com.google.android.exoplayer2.util.Log;
import java.lang.annotation.Documented; import java.lang.annotation.Documented;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
@ -39,7 +40,7 @@ public final class WebvttCue extends Cue {
long startTime, long startTime,
long endTime, long endTime,
CharSequence text, CharSequence text,
Alignment textAlignment, @Nullable Alignment textAlignment,
float line, float line,
@Cue.LineType int lineType, @Cue.LineType int lineType,
@Cue.AnchorType int lineAnchor, @Cue.AnchorType int lineAnchor,
@ -129,6 +130,9 @@ public final class WebvttCue extends Cue {
// Initialization methods // Initialization methods
// Calling reset() is forbidden because `this` isn't initialized. This can be safely
// suppressed because reset() only assigns fields, it doesn't read any.
@SuppressWarnings("nullness:method.invocation.invalid")
public Builder() { public Builder() {
reset(); reset();
} }
@ -168,7 +172,7 @@ public final class WebvttCue extends Cue {
return new WebvttCue( return new WebvttCue(
startTime, startTime,
endTime, endTime,
text, Assertions.checkNotNull(text),
convertTextAlignment(textAlignment), convertTextAlignment(textAlignment),
line, line,
lineType, lineType,
@ -277,6 +281,7 @@ public final class WebvttCue extends Cue {
} }
} }
@Nullable
private static Alignment convertTextAlignment(@TextAlignment int textAlignment) { private static Alignment convertTextAlignment(@TextAlignment int textAlignment) {
switch (textAlignment) { switch (textAlignment) {
case TextAlignment.START: case TextAlignment.START: