Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-6791

MPNSPushNotificationSender - Use isEmpty() to check whether the collection is empty or not

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • None
    • None
    • None

    Description

      In /unifiedpush/message/sender/MPNSPushNotificationSender.java, you can find checks like

       if (images.size() >= 1) {
                           //DO sth
      }
      

      or

       if (textFields.size() >= 1) {
                  // DO sth
       }
      

      They can be changed by using isEmpty method.
      Using Collection.size() to test for emptiness works, but using Collection.isEmpty() makes the code more readable and can be more performant. The time complexity of any isEmpty() method implementation should be O(1) whereas some implementations of size() can be O

      Attachments

        Activity

          People

            Unassigned Unassigned
            polina.n.koleva Polina Koleva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: