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

remove dependency on AbstractList, AbstractCollection, AbstractMap

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: