Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-5504

Check emptiness with Collection.isEmpty()

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 17.0.0.Beta3, 17.0.0.Final
    • 17.0.0.Beta2
    • None
    • None

    Description

      Check emptiness with Collection.isEmpty() instead of size(). The time complexity of any isEmpty() method implementation should be O ( 1 ) whereas some implementations of size() can be O ( n ).
      Refers to https://rules.sonarsource.com/java/RSPEC-1155

      Attachments

        Activity

          People

            jmesnil1@redhat.com Jeff Mesnil
            xf01213 Boris Unckel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: