JDK-4183159 : SequenceInputStream(ListIterator) constructor to enforce ordering
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.0
  • Priority: P5
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 1998-10-21
  • Updated: 2017-07-20
  • Resolved: 2017-07-20
Related Reports
Relates :  
Description
Name: diC59631			Date: 10/21/98


SequenceInputStream has a constructor
that takes an Enumeration as argument
this should be deprecated and replaced
by a ListIterator argument
rationale: ordering is not part of the
Enumeration contract (you just get ALL the elements)
but it is part of the ListIterator semantics
since ordering is important for SequenceStreams
the argument should be a ListIterator.

this specs. snag brought to me by
Jean-Louis DEWEZ (<###@###.###>)
(Review ID: 40923)
======================================================================

Comments
The order of elements retrieved from an Enumeration will reflect the ordering of whatever it's based on. The existing spec does say that the input streams are read in order. If the underlying source is something like a HashSet that doesn't have an order, then the semantics are ill-defined -- but an Enumeration over a HashSet will have *some* order, just not a specified and repeatable one, and SequenceInputStream will read the streams in that order. For sources that are ordered, such as Lists/Vectors or arrays, getting an Enumeration from them does the expected thing. I don't think a clarification is even necessary here. Closing as Not an Issue.
20-07-2017