RFR JDK-8069211: (zipfs) ZipFileSystem creates corrupted zip if entry output stream gets closed more than once

Francis Galiegue fgaliegue at gmail.com
Fri Jan 16 21:06:45 UTC 2015


On Fri, Jan 16, 2015 at 10:00 PM, Xueming Shen <xueming.shen at oracle.com> wrote:
[...]
>
> Yes, not only the zipfs.  lots of the streams from the j.u.zip pacakge are
> not "thread safe". We probably
> need take a look later. It really does not make lots of sense to share an io
> stream among multiple threads
> though.
>

However the possibility remains that from a same filesystem, two
threads can open a stream to the same resource.

Sure, the result is ultimately undefined as to the file contents, but
the fs does not get corrupted... Note: not tested this scenario yet.

-- 
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/parboiled1/grappa (redde
Caesaris: https://github.com/sirthias)


More information about the nio-dev mailing list