Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-14972

Check emptiness with Collection.isEmpty()

    XMLWordPrintable

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

      Issue Links

        Activity

          People

            bstansbe@redhat.com Brian Stansberry
            xf01213 Boris Unckel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: