Lint: 'size() == 0' replaceable with 'isEmpty()'
This commit is contained in:
parent
00b08318a5
commit
773bde14ab
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
|
|||
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());
|
||||
|
|
|
@ -256,7 +256,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||
if (!TextUtils.isEmpty(searchString)) {
|
||||
if (wasLoading.getAndSet(false)) {
|
||||
search(searchString, contentFilter, sortFilter);
|
||||
} else if (infoListAdapter.getItemsList().size() == 0) {
|
||||
} else if (infoListAdapter.getItemsList().isEmpty()) {
|
||||
if (savedState == null) {
|
||||
search(searchString, contentFilter, sortFilter);
|
||||
} else if (!isLoading.get() && !wasSearchFocused) {
|
||||
|
@ -977,7 +977,7 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
|
|||
lastSearchedString = searchString;
|
||||
nextPage = result.getNextPage();
|
||||
|
||||
if (infoListAdapter.getItemsList().size() == 0) {
|
||||
if (infoListAdapter.getItemsList().isEmpty()) {
|
||||
if (!result.getRelatedItems().isEmpty()) {
|
||||
infoListAdapter.addInfoItemList(result.getRelatedItems());
|
||||
} else {
|
||||
|
|
|
@ -81,7 +81,7 @@ public class TabsJsonHelperTest {
|
|||
private boolean isTabsArrayEmpty(final String returnedJson) throws JsonParserException {
|
||||
final JsonObject jsonObject = JsonParser.object().from(returnedJson);
|
||||
assertTrue(jsonObject.containsKey(JSON_TABS_ARRAY_KEY));
|
||||
return jsonObject.getArray(JSON_TABS_ARRAY_KEY).size() == 0;
|
||||
return jsonObject.getArray(JSON_TABS_ARRAY_KEY).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue