Fix a bunch of misc analysis warnings
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=209758330
This commit is contained in:
parent
9ccbb5bd6d
commit
9f0303b079
@ -39,7 +39,7 @@ class CombinedJavadocPlugin implements Plugin<Project> {
|
||||
libraryModules.each { libraryModule ->
|
||||
libraryModule.android.libraryVariants.all { variant ->
|
||||
def name = variant.buildType.name
|
||||
if (name.equals("release")) {
|
||||
if (name == "release") {
|
||||
classpath +=
|
||||
libraryModule.project.files(
|
||||
variant.javaCompile.classpath.files,
|
||||
@ -63,7 +63,7 @@ class CombinedJavadocPlugin implements Plugin<Project> {
|
||||
}
|
||||
|
||||
// Returns Android library modules that declare a generateJavadoc task.
|
||||
private Set<Project> getLibraryModules(Project project) {
|
||||
private static Set<Project> getLibraryModules(Project project) {
|
||||
project.subprojects.findAll {
|
||||
it.plugins.findPlugin("com.android.library") &&
|
||||
it.tasks.findByName("generateJavadoc")
|
||||
|
@ -418,6 +418,7 @@ public final class C {
|
||||
/** Indicates that a buffer is (at least partially) encrypted. */
|
||||
public static final int BUFFER_FLAG_ENCRYPTED = 1 << 30; // 0x40000000
|
||||
/** Indicates that a buffer should be decoded but not rendered. */
|
||||
@SuppressWarnings("NumericOverflow")
|
||||
public static final int BUFFER_FLAG_DECODE_ONLY = 1 << 31; // 0x80000000
|
||||
|
||||
/**
|
||||
|
@ -424,12 +424,10 @@ public interface Player {
|
||||
*/
|
||||
int STATE_ENDED = 4;
|
||||
|
||||
/**
|
||||
* Repeat modes for playback.
|
||||
*/
|
||||
/** Repeat modes for playback. */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({REPEAT_MODE_OFF, REPEAT_MODE_ONE, REPEAT_MODE_ALL})
|
||||
public @interface RepeatMode {}
|
||||
@interface RepeatMode {}
|
||||
/**
|
||||
* Normal playback without repetition.
|
||||
*/
|
||||
@ -452,7 +450,7 @@ public interface Player {
|
||||
DISCONTINUITY_REASON_AD_INSERTION,
|
||||
DISCONTINUITY_REASON_INTERNAL
|
||||
})
|
||||
public @interface DiscontinuityReason {}
|
||||
@interface DiscontinuityReason {}
|
||||
/**
|
||||
* Automatic playback transition from one period in the timeline to the next. The period index may
|
||||
* be the same as it was before the discontinuity in case the current period is repeated.
|
||||
@ -470,13 +468,14 @@ public interface Player {
|
||||
/** Discontinuity introduced internally by the source. */
|
||||
int DISCONTINUITY_REASON_INTERNAL = 4;
|
||||
|
||||
/**
|
||||
* Reasons for timeline and/or manifest changes.
|
||||
*/
|
||||
/** Reasons for timeline and/or manifest changes. */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({TIMELINE_CHANGE_REASON_PREPARED, TIMELINE_CHANGE_REASON_RESET,
|
||||
TIMELINE_CHANGE_REASON_DYNAMIC})
|
||||
public @interface TimelineChangeReason {}
|
||||
@IntDef({
|
||||
TIMELINE_CHANGE_REASON_PREPARED,
|
||||
TIMELINE_CHANGE_REASON_RESET,
|
||||
TIMELINE_CHANGE_REASON_DYNAMIC
|
||||
})
|
||||
@interface TimelineChangeReason {}
|
||||
/**
|
||||
* Timeline and manifest changed as a result of a player initialization with new media.
|
||||
*/
|
||||
|
@ -231,7 +231,7 @@ public final class PlayerMessage {
|
||||
* Player.EventListener#onPlayerError(ExoPlaybackException)}.
|
||||
*
|
||||
* @return This message.
|
||||
* @throws IllegalStateException If {@link #send()} has already been called.
|
||||
* @throws IllegalStateException If this message has already been sent.
|
||||
*/
|
||||
public PlayerMessage send() {
|
||||
Assertions.checkState(!isSent);
|
||||
|
@ -202,7 +202,7 @@ public interface Renderer extends PlayerMessage.Target {
|
||||
* @param operatingRate The operating rate.
|
||||
* @throws ExoPlaybackException If an error occurs handling the operating rate.
|
||||
*/
|
||||
default void setOperatingRate(float operatingRate) throws ExoPlaybackException {};
|
||||
default void setOperatingRate(float operatingRate) throws ExoPlaybackException {}
|
||||
|
||||
/**
|
||||
* Incrementally renders the {@link SampleStream}.
|
||||
|
@ -39,12 +39,10 @@ public interface DrmSession<T extends ExoMediaCrypto> {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the DRM session.
|
||||
*/
|
||||
/** The state of the DRM session. */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({STATE_RELEASED, STATE_ERROR, STATE_OPENING, STATE_OPENED, STATE_OPENED_WITH_KEYS})
|
||||
public @interface State {}
|
||||
@interface State {}
|
||||
/**
|
||||
* The session has been released.
|
||||
*/
|
||||
|
@ -81,7 +81,6 @@ public final class AdtsReader implements ElementaryStreamReader {
|
||||
private int firstFrameSampleRateIndex;
|
||||
|
||||
private int currentFrameVersion;
|
||||
private int currentFrameSampleRateIndex;
|
||||
|
||||
// Used when parsing the header.
|
||||
private boolean hasOutputFormat;
|
||||
@ -327,7 +326,7 @@ public final class AdtsReader implements ElementaryStreamReader {
|
||||
adtsScratch.data[0] = buffer.data[buffer.getPosition()];
|
||||
|
||||
adtsScratch.setPosition(2);
|
||||
currentFrameSampleRateIndex = adtsScratch.readBits(4);
|
||||
int currentFrameSampleRateIndex = adtsScratch.readBits(4);
|
||||
if (firstFrameSampleRateIndex != C.INDEX_UNSET
|
||||
&& currentFrameSampleRateIndex != firstFrameSampleRateIndex) {
|
||||
// Invalid header.
|
||||
|
@ -56,8 +56,8 @@ public final class Tx3gDecoder extends SimpleSubtitleDecoder {
|
||||
private static final int FONT_FACE_ITALIC = 0x0002;
|
||||
private static final int FONT_FACE_UNDERLINE = 0x0004;
|
||||
|
||||
private static final int SPAN_PRIORITY_LOW = (0xFF << Spanned.SPAN_PRIORITY_SHIFT);
|
||||
private static final int SPAN_PRIORITY_HIGH = (0x00 << Spanned.SPAN_PRIORITY_SHIFT);
|
||||
private static final int SPAN_PRIORITY_LOW = 0xFF << Spanned.SPAN_PRIORITY_SHIFT;
|
||||
private static final int SPAN_PRIORITY_HIGH = 0;
|
||||
|
||||
private static final int DEFAULT_FONT_FACE = 0;
|
||||
private static final int DEFAULT_COLOR = Color.WHITE;
|
||||
|
@ -191,7 +191,7 @@ public final class SimpleCache implements Cache {
|
||||
Assertions.checkState(!released);
|
||||
CachedContent cachedContent = index.get(key);
|
||||
return cachedContent == null || cachedContent.isEmpty()
|
||||
? new TreeSet<CacheSpan>()
|
||||
? new TreeSet<>()
|
||||
: new TreeSet<CacheSpan>(cachedContent.getSpans());
|
||||
}
|
||||
|
||||
|
@ -401,8 +401,8 @@ public final class SilenceSkippingAudioProcessorTest {
|
||||
public void appendFrames(int count, short... channelLevels) {
|
||||
Assertions.checkState(!built);
|
||||
for (int i = 0; i < count; i += channelCount) {
|
||||
for (int j = 0; j < channelLevels.length; j++) {
|
||||
buffer.put(channelLevels[j]);
|
||||
for (short channelLevel : channelLevels) {
|
||||
buffer.put(channelLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,15 +95,15 @@ public class MergingMediaSourceTest {
|
||||
for (int i = 0; i < timelines.length; i++) {
|
||||
mediaSources[i] = new FakeMediaSource(timelines[i], null);
|
||||
}
|
||||
MergingMediaSource mediaSource = new MergingMediaSource(mediaSources);
|
||||
MediaSourceTestRunner testRunner = new MediaSourceTestRunner(mediaSource, null);
|
||||
MergingMediaSource mergingMediaSource = new MergingMediaSource(mediaSources);
|
||||
MediaSourceTestRunner testRunner = new MediaSourceTestRunner(mergingMediaSource, null);
|
||||
try {
|
||||
Timeline timeline = testRunner.prepareSource();
|
||||
// The merged timeline should always be the one from the first child.
|
||||
assertThat(timeline).isEqualTo(timelines[0]);
|
||||
testRunner.releaseSource();
|
||||
for (int i = 0; i < mediaSources.length; i++) {
|
||||
mediaSources[i].assertReleased();
|
||||
for (FakeMediaSource mediaSource : mediaSources) {
|
||||
mediaSource.assertReleased();
|
||||
}
|
||||
} finally {
|
||||
testRunner.release();
|
||||
|
@ -61,8 +61,7 @@ public final class CachedRegionTrackerTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
when(cache.addListener(anyString(), any(Cache.Listener.class)))
|
||||
.thenReturn(new TreeSet<CacheSpan>());
|
||||
when(cache.addListener(anyString(), any(Cache.Listener.class))).thenReturn(new TreeSet<>());
|
||||
tracker = new CachedRegionTracker(cache, CACHE_KEY, CHUNK_INDEX);
|
||||
cacheDir = Util.createTempDirectory(RuntimeEnvironment.application, "ExoPlayerTest");
|
||||
index = new CachedContentIndex(cacheDir);
|
||||
|
@ -191,8 +191,7 @@ public class HlsDownloaderTest {
|
||||
private static ArrayList<StreamKey> getKeys(int... variantIndices) {
|
||||
ArrayList<StreamKey> streamKeys = new ArrayList<>();
|
||||
for (int variantIndex : variantIndices) {
|
||||
final int trackIndex = variantIndex;
|
||||
streamKeys.add(new StreamKey(HlsMasterPlaylist.GROUP_INDEX_VARIANT, trackIndex));
|
||||
streamKeys.add(new StreamKey(HlsMasterPlaylist.GROUP_INDEX_VARIANT, variantIndex));
|
||||
}
|
||||
return streamKeys;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
|
||||
|
||||
/**
|
||||
* @param xmlParser The underlying {@link XmlPullParser}
|
||||
* @throws ParserException
|
||||
* @throws ParserException If a parsing error occurs.
|
||||
*/
|
||||
protected void parseStartTag(XmlPullParser xmlParser) throws ParserException {
|
||||
// Do nothing.
|
||||
|
@ -64,9 +64,7 @@ public class SsManifestTest {
|
||||
SsManifest sourceManifest =
|
||||
newSsManifest(newStreamElement("1", formats[0]), newStreamElement("2", formats[1]));
|
||||
|
||||
List<StreamKey> keys = Arrays.asList(new StreamKey(1, 0));
|
||||
// Keys don't need to be in any particular order
|
||||
Collections.shuffle(keys, new Random(0));
|
||||
List<StreamKey> keys = Collections.singletonList(new StreamKey(1, 0));
|
||||
|
||||
SsManifest copyManifest = sourceManifest.copy(keys);
|
||||
|
||||
|
@ -14,12 +14,14 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layoutDirection="ltr"
|
||||
android:background="#CC000000"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
tools:targetApi="28">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -95,7 +95,7 @@ public final class TestDownloadManagerListener implements DownloadManager.Listen
|
||||
private ArrayBlockingQueue<Integer> getStateQueue(DownloadAction action) {
|
||||
synchronized (actionStates) {
|
||||
if (!actionStates.containsKey(action)) {
|
||||
actionStates.put(action, new ArrayBlockingQueue<Integer>(10));
|
||||
actionStates.put(action, new ArrayBlockingQueue<>(10));
|
||||
}
|
||||
return actionStates.get(action);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user