RFR JDK-8012645: Stream methods on BitSet, Random, ThreadLocalRandom, ZipFile

Steven Schlansker stevenschlansker at gmail.com
Tue Apr 30 17:01:11 UTC 2013


On Apr 30, 2013, at 9:35 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:

> On Apr 30, 2013, at 5:43 PM, Henry Jen <henry.jen at oracle.com> wrote:
>> 
>>> So if possible we should report ORDERED and state the association, if any, of encounter order with the order declared in the central directory, which i hope is, and seems to be, the same. (Plus update the docs of entries() too.)
>>> 
>> 
>> I agree with you entries() and streams() should be in sync on ordering. Spec-wise, I have no clear preference.
> 
>> But when I looked into a zip file archive, I always would like to see entries in alphabetic order so I can find the files I really care, which will also have directory structure nicely. Order in central directory not necessary helping me.
>> 
> 
> There does appear to be a well-defined encounter order. I don't think most developers will consider the collection of zip entries to behave like a Set. It is more list-like.

For what it's worth, as a random developer that has used Zip[Input,Output]Stream on occasion, I sometimes depend on the ordering property for application specific uses.  The most common is if you are taking a "hot backup" or "hot restore" of some sort of data structure, you would wish to ensure that data is written in / out in "data dependency order" so that you don't write references to data that has not been restored yet.

I am not sure that this is a good justification for keeping the stream ORDERED, but maybe it is.

Best,
Steven




More information about the core-libs-dev mailing list