Commit 6d35c8db authored by Aiden Benner's avatar Aiden Benner Committed by Commit Bot

Chromecast: Fix redundant field initializations

In preparation for enabling an ErrorProne check to ban them

Bug: 878853
Change-Id: I267c5260c03e768ebcb732fed1a8966c4f598857
Reviewed-on: https://chromium-review.googlesource.com/1214086Reviewed-by: default avatarSimeon Anfinrud <sanfin@chromium.org>
Commit-Queue: Aiden Benner <abenner@google.com>
Cr-Commit-Position: refs/heads/master@{#589900}
parent d37da64f
...@@ -24,7 +24,7 @@ public class Controller<T> extends Observable<T> { ...@@ -24,7 +24,7 @@ public class Controller<T> extends Observable<T> {
private final Sequencer mSequencer = new Sequencer(); private final Sequencer mSequencer = new Sequencer();
private final List<Observer<? super T>> mObservers = new ArrayList<>(); private final List<Observer<? super T>> mObservers = new ArrayList<>();
private final Map<Observer<? super T>, Scope> mScopeMap = new HashMap<>(); private final Map<Observer<? super T>, Scope> mScopeMap = new HashMap<>();
private T mData = null; private T mData;
@Override @Override
public Subscription subscribe(Observer<? super T> observer) { public Subscription subscribe(Observer<? super T> observer) {
...@@ -101,7 +101,7 @@ public class Controller<T> extends Observable<T> { ...@@ -101,7 +101,7 @@ public class Controller<T> extends Observable<T> {
// TODO(sanfin): make this its own public class and add tests. // TODO(sanfin): make this its own public class and add tests.
private static class Sequencer { private static class Sequencer {
private boolean mIsRunning = false; private boolean mIsRunning;
private final ArrayDeque<Runnable> mMessageQueue = new ArrayDeque<>(); private final ArrayDeque<Runnable> mMessageQueue = new ArrayDeque<>();
/** /**
......
...@@ -14,7 +14,7 @@ package org.chromium.chromecast.base; ...@@ -14,7 +14,7 @@ package org.chromium.chromecast.base;
* instantiable). * instantiable).
*/ */
public final class Unit { public final class Unit {
private static Unit sInstance = null; private static Unit sInstance;
private Unit() {} private Unit() {}
public static Unit unit() { public static Unit unit() {
if (sInstance == null) sInstance = new Unit(); if (sInstance == null) sInstance = new Unit();
......
...@@ -22,7 +22,7 @@ import org.chromium.chromecast.base.Observable; ...@@ -22,7 +22,7 @@ import org.chromium.chromecast.base.Observable;
*/ */
public class CastAudioManager { public class CastAudioManager {
private static final String TAG = "CastAudioManager"; private static final String TAG = "CastAudioManager";
private static CastAudioManager sInstance = null; private static CastAudioManager sInstance;
public static CastAudioManager getAudioManager(Context context) { public static CastAudioManager getAudioManager(Context context) {
if (sInstance == null) { if (sInstance == null) {
......
...@@ -23,7 +23,7 @@ public class CastBrowserHelper { ...@@ -23,7 +23,7 @@ public class CastBrowserHelper {
private static final String TAG = "CastBrowserHelper"; private static final String TAG = "CastBrowserHelper";
private static final String COMMAND_LINE_FILE = "castshell-command-line"; private static final String COMMAND_LINE_FILE = "castshell-command-line";
private static boolean sIsBrowserInitialized = false; private static boolean sIsBrowserInitialized;
/** /**
* Starts the browser process synchronously, returning success or failure. If the browser has * Starts the browser process synchronously, returning success or failure. If the browser has
......
...@@ -12,7 +12,7 @@ import java.util.concurrent.ScheduledExecutorService; ...@@ -12,7 +12,7 @@ import java.util.concurrent.ScheduledExecutorService;
* schedule all tasks on one thread. * schedule all tasks on one thread.
*/ */
public final class CastCrashUploaderFactory { public final class CastCrashUploaderFactory {
private static ScheduledExecutorService sExecutorService = null; private static ScheduledExecutorService sExecutorService;
public static CastCrashUploader createCastCrashUploader(String crashDumpPath, String uuid, public static CastCrashUploader createCastCrashUploader(String crashDumpPath, String uuid,
String applicationFeedback, boolean uploadCrashToStaging) { String applicationFeedback, boolean uploadCrashToStaging) {
if (sExecutorService == null) { if (sExecutorService == null) {
......
...@@ -71,7 +71,7 @@ public class CastWebContentsComponent { ...@@ -71,7 +71,7 @@ public class CastWebContentsComponent {
@VisibleForTesting @VisibleForTesting
class ActivityDelegate implements Delegate { class ActivityDelegate implements Delegate {
private static final String TAG = "cr_CastWebContent_AD"; private static final String TAG = "cr_CastWebContent_AD";
private boolean mStarted = false; private boolean mStarted;
@Override @Override
public void start(StartParams params) { public void start(StartParams params) {
......
...@@ -50,7 +50,7 @@ class CastWebContentsSurfaceHelper { ...@@ -50,7 +50,7 @@ class CastWebContentsSurfaceHelper {
private MediaSessionGetter mMediaSessionGetter; private MediaSessionGetter mMediaSessionGetter;
// TODO(vincentli) interrupt touch event from Fragment's root view when it's false. // TODO(vincentli) interrupt touch event from Fragment's root view when it's false.
private boolean mTouchInputEnabled = false; private boolean mTouchInputEnabled;
public static class StartParams { public static class StartParams {
public final Uri uri; public final Uri uri;
......
...@@ -57,8 +57,8 @@ public class CastWebContentsSurfaceHelperTest { ...@@ -57,8 +57,8 @@ public class CastWebContentsSurfaceHelperTest {
private static class StartParamsBuilder { private static class StartParamsBuilder {
private String mId = "0"; private String mId = "0";
private WebContents mWebContents = mock(WebContents.class); private WebContents mWebContents = mock(WebContents.class);
private boolean mIsRemoteControlMode = false; private boolean mIsRemoteControlMode;
private boolean mIsTouchInputEnabled = false; private boolean mIsTouchInputEnabled;
public StartParamsBuilder withId(String id) { public StartParamsBuilder withId(String id) {
mId = id; mId = id;
......
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 to comment