From 773bde14ab29fe068356aaa47e57f0dcd1a11801 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 18 Nov 2020 17:54:16 -0500 Subject: [PATCH] Lint: 'size() == 0' replaceable with 'isEmpty()' --- .../schabi/newpipe/fragments/detail/VideoDetailFragment.java | 2 +- .../schabi/newpipe/fragments/list/BaseListInfoFragment.java | 2 +- .../schabi/newpipe/fragments/list/search/SearchFragment.java | 4 ++-- .../org/schabi/newpipe/settings/tabs/TabsJsonHelperTest.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 67bc51c58..b9140c41c 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -1140,7 +1140,7 @@ public final class VideoDetailFragment PlayQueue queue = playQueue; // Size can be 0 because queue removes bad stream automatically when error occurs - if (queue == null || queue.size() == 0) { + if (queue == null || queue.isEmpty()) { queue = new SinglePlayQueue(currentInfo); } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java index f21eb5291..43fc74922 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java @@ -204,7 +204,7 @@ public abstract class BaseListInfoFragment name = result.getName(); setTitle(name); - if (infoListAdapter.getItemsList().size() == 0) { + if (infoListAdapter.getItemsList().isEmpty()) { if (result.getRelatedItems().size() > 0) { infoListAdapter.addInfoItemList(result.getRelatedItems()); showListFooter(hasMoreItems()); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 1e54176d4..1452241aa 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -256,7 +256,7 @@ public class SearchFragment extends BaseListFragment