Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5030

Collection.isEmpty() should be used to test for emptiness

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • Core 2.1.0
    • None
    • None

    Description

      There are ~40 checks for whether a collection is or is not empty using the Collection.size() and a less than or greater than 0.

      It is cleaner to use the Collection.isEmpty()

      Refer to sonar

      https://ci.openmrs.org/sonar/drilldown/issues/1865?severity=CRITICAL

      to find the related code.

      The rule that is violated is "Collection.isEmpty() should be used to test for emptiness" which can be found under the severity critical.

      Gliffy Diagrams

        Attachments

          Activity

            People

              reubenv Reuben Varghese
              teleivo Ivo Ulrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: