forked from upstream-mirrors/quik
squid:S1155 - Collection.isEmpty() should be used to test for emptiness
This commit is contained in:
@@ -140,7 +140,7 @@ public class DhcpInfoInternal {
|
|||||||
dns2 = orig.dns2;
|
dns2 = orig.dns2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRoutes.size() == 0) {
|
if (mRoutes.isEmpty()) {
|
||||||
for (RouteInfo route : orig.getRoutes()) {
|
for (RouteInfo route : orig.getRoutes()) {
|
||||||
addRoute(route);
|
addRoute(route);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public abstract class ElementTimeImpl implements ElementTime {
|
|||||||
// Ignore badly formatted times
|
// Ignore badly formatted times
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (beginTimeList.size() == 0) {
|
if (beginTimeList.isEmpty()) {
|
||||||
/*
|
/*
|
||||||
* What is the right default value?
|
* What is the right default value?
|
||||||
*
|
*
|
||||||
@@ -139,7 +139,7 @@ public abstract class ElementTimeImpl implements ElementTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// "end" time is not specified
|
// "end" time is not specified
|
||||||
if (endTimeList.size() == 0) {
|
if (endTimeList.isEmpty()) {
|
||||||
// Get duration
|
// Get duration
|
||||||
float duration = getDur();
|
float duration = getDur();
|
||||||
|
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ public class TransactionService extends Service implements Observer {
|
|||||||
try {
|
try {
|
||||||
synchronized (mProcessing) {
|
synchronized (mProcessing) {
|
||||||
mProcessing.remove(transaction);
|
mProcessing.remove(transaction);
|
||||||
if (mPending.size() > 0) {
|
if (!mPending.isEmpty()) {
|
||||||
if (LOCAL_LOGV) Log.v(TAG, "update: handle next pending transaction...");
|
if (LOCAL_LOGV) Log.v(TAG, "update: handle next pending transaction...");
|
||||||
Message msg = mServiceHandler.obtainMessage(
|
Message msg = mServiceHandler.obtainMessage(
|
||||||
EVENT_HANDLE_NEXT_PENDING_TRANSACTION,
|
EVENT_HANDLE_NEXT_PENDING_TRANSACTION,
|
||||||
@@ -799,7 +799,7 @@ public class TransactionService extends Service implements Observer {
|
|||||||
|
|
||||||
public void markAllPendingTransactionsAsFailed() {
|
public void markAllPendingTransactionsAsFailed() {
|
||||||
synchronized (mProcessing) {
|
synchronized (mProcessing) {
|
||||||
while (mPending.size() != 0) {
|
while (!mPending.isEmpty()) {
|
||||||
Transaction transaction = mPending.remove(0);
|
Transaction transaction = mPending.remove(0);
|
||||||
transaction.mTransactionState.setState(TransactionState.FAILED);
|
transaction.mTransactionState.setState(TransactionState.FAILED);
|
||||||
if (transaction instanceof SendTransaction) {
|
if (transaction instanceof SendTransaction) {
|
||||||
@@ -824,7 +824,7 @@ public class TransactionService extends Service implements Observer {
|
|||||||
int numProcessTransaction;
|
int numProcessTransaction;
|
||||||
|
|
||||||
synchronized (mProcessing) {
|
synchronized (mProcessing) {
|
||||||
if (mPending.size() != 0) {
|
if (!mPending.isEmpty()) {
|
||||||
transaction = mPending.remove(0);
|
transaction = mPending.remove(0);
|
||||||
}
|
}
|
||||||
numProcessTransaction = mProcessing.size();
|
numProcessTransaction = mProcessing.size();
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class DraftCache {
|
|||||||
// If nobody's interested in finding out about changes,
|
// If nobody's interested in finding out about changes,
|
||||||
// just bail out early.
|
// just bail out early.
|
||||||
synchronized (mChangeListenersLock) {
|
synchronized (mChangeListenersLock) {
|
||||||
if (mChangeListeners.size() < 1) {
|
if (mChangeListeners.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -503,14 +503,14 @@ public class Contact {
|
|||||||
while (true) {
|
while (true) {
|
||||||
Runnable r = null;
|
Runnable r = null;
|
||||||
synchronized (mThingsToLoad) {
|
synchronized (mThingsToLoad) {
|
||||||
if (mThingsToLoad.size() == 0) {
|
if (mThingsToLoad.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
mThingsToLoad.wait();
|
mThingsToLoad.wait();
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
break; // Exception sent by Contact.init() to stop Runnable
|
break; // Exception sent by Contact.init() to stop Runnable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mThingsToLoad.size() > 0) {
|
if (!mThingsToLoad.isEmpty()) {
|
||||||
r = mThingsToLoad.remove(0);
|
r = mThingsToLoad.remove(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1175,7 +1175,7 @@ public class Contact {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (candidates.size() == 0) {
|
if (candidates.isEmpty()) {
|
||||||
mContactsHash.remove(key);
|
mContactsHash.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class ExifData {
|
|||||||
* Returns true if this header contains uncompressed strip.
|
* Returns true if this header contains uncompressed strip.
|
||||||
*/
|
*/
|
||||||
protected boolean hasUncompressedStrip() {
|
protected boolean hasUncompressedStrip() {
|
||||||
return mStripBytes.size() != 0;
|
return !mStripBytes.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,7 +264,7 @@ class ExifData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret.size() == 0) {
|
if (ret.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -287,7 +287,7 @@ class ExifData {
|
|||||||
for (ExifTag t : tags) {
|
for (ExifTag t : tags) {
|
||||||
ret.add(t);
|
ret.add(t);
|
||||||
}
|
}
|
||||||
if (ret.size() == 0) {
|
if (ret.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -307,7 +307,7 @@ class ExifData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret.size() == 0) {
|
if (ret.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -2348,7 +2348,7 @@ public class ExifInterface {
|
|||||||
l.add(ifds[i]);
|
l.add(ifds[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (l.size() <= 0) {
|
if (l.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
int[] ret = new int[l.size()];
|
int[] ret = new int[l.size()];
|
||||||
|
|||||||
@@ -921,7 +921,7 @@ public class IabHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skuList.size() == 0) {
|
if (skuList.isEmpty()) {
|
||||||
logDebug("queryPrices: nothing to do because there are no SKUs.");
|
logDebug("queryPrices: nothing to do because there are no SKUs.");
|
||||||
return BILLING_RESPONSE_RESULT_OK;
|
return BILLING_RESPONSE_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public abstract class MediaModel extends Model implements EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MediaAction getCurrentAction() {
|
public MediaAction getCurrentAction() {
|
||||||
if (0 == mMediaActions.size()) {
|
if (mMediaActions.isEmpty()) {
|
||||||
return MediaAction.NO_ACTIVE_ACTION;
|
return MediaAction.NO_ACTIVE_ACTION;
|
||||||
}
|
}
|
||||||
return mMediaActions.remove(0);
|
return mMediaActions.remove(0);
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ public class DeliveryReportHelper {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reportReqs.size() == 0) {
|
if (reportReqs.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ public class MMSSetupFragment extends QKFragment implements DialogFragmentListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showConfigurationDialog() {
|
private void showConfigurationDialog() {
|
||||||
if (mAPNs.size() == 0) {
|
if (mAPNs.isEmpty()) {
|
||||||
// Give the user a support channel and further instructions if automatic
|
// Give the user a support channel and further instructions if automatic
|
||||||
// configuration failed.
|
// configuration failed.
|
||||||
launchDialog(NO_CONFIGURATIONS_FOUND);
|
launchDialog(NO_CONFIGURATIONS_FOUND);
|
||||||
|
|||||||
Reference in New Issue
Block a user