Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4068c6f3 authored by Moez Bhatti's avatar Moez Bhatti Committed by GitHub
Browse files

Merge pull request #543 from...

Merge pull request #543 from DevFactory/release/collection.isEmpty()-should-be-used-to-test-for-emptiness-fix-1

squid:S1155 - Collection.isEmpty() should be used to test for emptiness
parents 5580d5e2 5cc97552
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class DhcpInfoInternal {
            dns2 = orig.dns2;
        }

        if (mRoutes.size() == 0) {
        if (mRoutes.isEmpty()) {
            for (RouteInfo route : orig.getRoutes()) {
                addRoute(route);
            }
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public abstract class ElementTimeImpl implements ElementTime {
                // Ignore badly formatted times
            }
        }
        if (beginTimeList.size() == 0) {
        if (beginTimeList.isEmpty()) {
            /*
             * What is the right default value?
             *
@@ -139,7 +139,7 @@ public abstract class ElementTimeImpl implements ElementTime {
        }

        // "end" time is not specified
        if (endTimeList.size() == 0) {
        if (endTimeList.isEmpty()) {
            // Get duration
            float duration = getDur();

+3 −3
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ public class TransactionService extends Service implements Observer {
        try {
            synchronized (mProcessing) {
                mProcessing.remove(transaction);
                if (mPending.size() > 0) {
                if (!mPending.isEmpty()) {
                    if (LOCAL_LOGV) Log.v(TAG, "update: handle next pending transaction...");
                    Message msg = mServiceHandler.obtainMessage(
                            EVENT_HANDLE_NEXT_PENDING_TRANSACTION,
@@ -799,7 +799,7 @@ public class TransactionService extends Service implements Observer {

        public void markAllPendingTransactionsAsFailed() {
            synchronized (mProcessing) {
                while (mPending.size() != 0) {
                while (!mPending.isEmpty()) {
                    Transaction transaction = mPending.remove(0);
                    transaction.mTransactionState.setState(TransactionState.FAILED);
                    if (transaction instanceof SendTransaction) {
@@ -824,7 +824,7 @@ public class TransactionService extends Service implements Observer {
            int numProcessTransaction;

            synchronized (mProcessing) {
                if (mPending.size() != 0) {
                if (!mPending.isEmpty()) {
                    transaction = mPending.remove(0);
                }
                numProcessTransaction = mProcessing.size();
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public class DraftCache {
            // If nobody's interested in finding out about changes,
            // just bail out early.
            synchronized (mChangeListenersLock) {
                if (mChangeListeners.size() < 1) {
                if (mChangeListeners.isEmpty()) {
                    return;
                }
            }
+3 −3
Original line number Diff line number Diff line
@@ -503,14 +503,14 @@ public class Contact {
                        while (true) {
                            Runnable r = null;
                            synchronized (mThingsToLoad) {
                                if (mThingsToLoad.size() == 0) {
                                if (mThingsToLoad.isEmpty()) {
                                    try {
                                        mThingsToLoad.wait();
                                    } catch (InterruptedException ex) {
                                        break;  // Exception sent by Contact.init() to stop Runnable
                                    }
                                }
                                if (mThingsToLoad.size() > 0) {
                                if (!mThingsToLoad.isEmpty()) {
                                    r = mThingsToLoad.remove(0);
                                }
                            }
@@ -1175,7 +1175,7 @@ public class Contact {
                            }
                        }
                    }
                    if (candidates.size() == 0) {
                    if (candidates.isEmpty()) {
                        mContactsHash.remove(key);
                    }
                }
Loading