Lint: Make a bunch of stuff final

This commit is contained in:
TacoTheDank 2020-11-18 17:50:00 -05:00
parent e25622df4b
commit 39e5d8ccc2
27 changed files with 55 additions and 55 deletions

View file

@ -50,8 +50,8 @@ public final class DownloaderImpl extends Downloader {
public static final String YOUTUBE_DOMAIN = "youtube.com";
private static DownloaderImpl instance;
private Map<String, String> mCookies;
private OkHttpClient client;
private final Map<String, String> mCookies;
private final OkHttpClient client;
private DownloaderImpl(final OkHttpClient.Builder builder) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {

View file

@ -23,7 +23,7 @@ public class License implements Parcelable, Serializable {
};
private final String abbreviation;
private final String name;
private String filename;
private final String filename;
public License(final String name, final String abbreviation, final String filename) {
if (name == null) {

View file

@ -43,7 +43,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
private SelectedTabsPagerAdapter pagerAdapter;
private ScrollableTabLayout tabLayout;
private List<Tab> tabsList = new ArrayList<>();
private final List<Tab> tabsList = new ArrayList<>();
private TabsManager tabsManager;
private boolean hasTabsChanged = false;

View file

@ -24,7 +24,7 @@ import io.reactivex.Single;
import io.reactivex.disposables.CompositeDisposable;
public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
private CompositeDisposable disposables = new CompositeDisposable();
private final CompositeDisposable disposables = new CompositeDisposable();
public static CommentsFragment getInstance(final int serviceId, final String url,
final String name) {

View file

@ -31,7 +31,7 @@ import io.reactivex.disposables.CompositeDisposable;
public class RelatedVideosFragment extends BaseListInfoFragment<RelatedStreamInfo>
implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String INFO_KEY = "related_info_key";
private CompositeDisposable disposables = new CompositeDisposable();
private final CompositeDisposable disposables = new CompositeDisposable();
private RelatedStreamInfo relatedStreamInfo;
/*//////////////////////////////////////////////////////////////////////////

View file

@ -38,7 +38,7 @@ public final class PlaylistAppendDialog extends PlaylistDialog {
private RecyclerView playlistRecyclerView;
private LocalItemListAdapter playlistAdapter;
private CompositeDisposable playlistDisposables = new CompositeDisposable();
private final CompositeDisposable playlistDisposables = new CompositeDisposable();
public static Disposable onPlaylistFound(
final Context context, final Runnable onSuccess, final Runnable onFailed

View file

@ -48,7 +48,7 @@ public final class NotificationUtil {
@Nullable private static NotificationUtil instance = null;
@NotificationConstants.Action
private int[] notificationSlots = NotificationConstants.SLOT_DEFAULTS.clone();
private final int[] notificationSlots = NotificationConstants.SLOT_DEFAULTS.clone();
private NotificationManagerCompat notificationManager;
private NotificationCompat.Builder notificationBuilder;

View file

@ -123,7 +123,7 @@ public class MediaSourceManager {
@NonNull
private ManagedMediaSourcePlaylist playlist;
private Handler removeMediaSourceHandler = new Handler();
private final Handler removeMediaSourceHandler = new Handler();
public MediaSourceManager(@NonNull final PlaybackListener listener,
@NonNull final PlayQueue playQueue) {

View file

@ -53,7 +53,7 @@ import io.reactivex.schedulers.Schedulers;
public class PeertubeInstanceListFragment extends Fragment {
private static final int MENU_ITEM_RESTORE_ID = 123456;
private List<PeertubeInstance> instanceList = new ArrayList<>();
private final List<PeertubeInstance> instanceList = new ArrayList<>();
private PeertubeInstance selectedInstance;
private String savedInstanceListKey;
private InstanceListAdapter instanceListAdapter;
@ -344,7 +344,7 @@ public class PeertubeInstanceListFragment extends Fragment {
private class InstanceListAdapter
extends RecyclerView.Adapter<InstanceListAdapter.TabViewHolder> {
private final LayoutInflater inflater;
private ItemTouchHelper itemTouchHelper;
private final ItemTouchHelper itemTouchHelper;
private RadioButton lastChecked;
InstanceListAdapter(final Context context, final ItemTouchHelper itemTouchHelper) {
@ -377,11 +377,11 @@ public class PeertubeInstanceListFragment extends Fragment {
}
class TabViewHolder extends RecyclerView.ViewHolder {
private AppCompatImageView instanceIconView;
private TextView instanceNameView;
private TextView instanceUrlView;
private RadioButton instanceRB;
private ImageView handle;
private final AppCompatImageView instanceIconView;
private final TextView instanceNameView;
private final TextView instanceUrlView;
private final RadioButton instanceRB;
private final ImageView handle;
TabViewHolder(final View itemView) {
super(itemView);

View file

@ -8,7 +8,7 @@ import androidx.preference.Preference;
import org.schabi.newpipe.R;
public class UpdateSettingsFragment extends BasePreferenceFragment {
private Preference.OnPreferenceChangeListener updatePreferenceChange
private final Preference.OnPreferenceChangeListener updatePreferenceChange
= (preference, newValue) -> {
defaultPreferences.edit()
.putBoolean(getString(R.string.update_app_key), (boolean) newValue).apply();

View file

@ -334,7 +334,7 @@ public class ChooseTabsFragment extends Fragment {
private class SelectedTabsAdapter
extends RecyclerView.Adapter<ChooseTabsFragment.SelectedTabsAdapter.TabViewHolder> {
private final LayoutInflater inflater;
private ItemTouchHelper itemTouchHelper;
private final ItemTouchHelper itemTouchHelper;
SelectedTabsAdapter(final Context context, final ItemTouchHelper itemTouchHelper) {
this.itemTouchHelper = itemTouchHelper;
@ -367,9 +367,9 @@ public class ChooseTabsFragment extends Fragment {
}
class TabViewHolder extends RecyclerView.ViewHolder {
private AppCompatImageView tabIconView;
private TextView tabNameView;
private ImageView handle;
private final AppCompatImageView tabIconView;
private final TextView tabNameView;
private final ImageView handle;
TabViewHolder(final View itemView) {
super(itemView);

View file

@ -156,7 +156,7 @@ public abstract class Tab {
CHANNEL(new ChannelTab()),
PLAYLIST(new PlaylistTab());
private Tab tab;
private final Tab tab;
Type(final Tab tab) {
this.tab = tab;

View file

@ -31,8 +31,8 @@ public class OggFromWebMWriter implements Closeable {
private boolean done = false;
private boolean parsed = false;
private SharpStream source;
private SharpStream output;
private final SharpStream source;
private final SharpStream output;
private int sequenceCount = 0;
private final int streamId;

View file

@ -20,8 +20,8 @@ import java.nio.charset.StandardCharsets;
public class SrtFromTtmlWriter {
private static final String NEW_LINE = "\r\n";
private SharpStream out;
private boolean ignoreEmptyFrames;
private final SharpStream out;
private final boolean ignoreEmptyFrames;
private final Charset charset = StandardCharsets.UTF_8;
private int frameIndex = 0;

View file

@ -49,7 +49,7 @@ public class WebMReader {
Audio/*2*/, Video/*1*/, Other
}
private DataReader stream;
private final DataReader stream;
private Segment segment;
private WebMTrack[] tracks;
private int selectedTrack;

View file

@ -24,7 +24,7 @@ public class TLSSocketFactoryCompat extends SSLSocketFactory {
private static TLSSocketFactoryCompat instance = null;
private SSLSocketFactory internalSSLSocketFactory;
private final SSLSocketFactory internalSSLSocketFactory;
public TLSSocketFactoryCompat() throws KeyManagementException, NoSuchAlgorithmException {
final SSLContext context = SSLContext.getInstance("TLS");

View file

@ -33,8 +33,8 @@ import androidx.recyclerview.widget.RecyclerView;
public class NewPipeRecyclerView extends RecyclerView {
private static final String TAG = "NewPipeRecyclerView";
private Rect focusRect = new Rect();
private Rect tempFocus = new Rect();
private final Rect focusRect = new Rect();
private final Rect tempFocus = new Rect();
private boolean allowDpadScroll = true;