Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8156070 Immutable Collections enhancements
  3. JDK-8165396

remove dependency on AbstractList, AbstractCollection, AbstractMap

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      The immutable lists are currently based on the AbstractList. This made bringup of the collection quick and easy. Unfortunately, this class includes a protected field modCount, which of course isn't used in the immutable collections. This takes up extra space in every instance. There are similar issues for Set and Map.

      It would be nice to refactor things to avoid this. An alternative would be to have something like AbstractImmutableList etc. that had the algorithms but not the extra space. The mutator method implementations would also throw UOE unconditionally instead of deferring to mutators that might or might not be overridden in subclasses. This implementation could also be shared with dependent collections like subList(), entrySet(), etc. derived from immutable collections.

            smarks Stuart Marks
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: