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

Check emptiness with Collection.isEmpty()

XMLWordPrintable

    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

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

              Created:
              Updated:
              Resolved: