Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8221921

Implement size() / isEmpty() in immutable collections

XMLWordPrintable

    • b16

      A few of the ImmutableCollections are inheriting size and/or isEmpty from abstract base classes. A few of these are inefficiently implemented, e.g., on a Map of one element isEmpty() will entrySet().size() == 0 when it could be implemented as "return false".

      Override such methods where it makes sense.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: