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

SequenceInputStream implementation can use an Iterator rather than Enumeration

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Any
      Java <= 21

      A DESCRIPTION OF THE PROBLEM :
      There was a PR created for an enhancement of SequenceInputStream [1]. It is a follow-up to an existing optimization done by earlier committers. Please consider this further optimization for inclusion into a later JDK (preferrably JDK 21).

      Description from the PR:

      enumeration(list) will create an enumeration, a list and an iterator whereas the implementation only requires an iterator
      this PR drops the enumeration wrapper for binary constructor and just maps the enumeration to an iterator for the other case which should be a better compromise in practice.

      Another side but nice effect is to have some lighter classloading (subgraph)

      [1]: https://github.com/openjdk/jdk/pull/11718


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: