RFR: 8276743: Make openjdk build Zip Archive generation "reproducible"
Andrew Leonard
aleonard at openjdk.java.net
Wed Nov 10 11:25:42 UTC 2021
On Tue, 9 Nov 2021 17:31:16 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>> You are already keeping all the filenames in memory for sorting, so reading up the ZipEntry:s isn't that much more data, just some extra metadata for each entry. The actual file contents is not part of the ZipEntry object. When actually copying the files, you can use the ZipFile class to access ZipEntry's in arbitrary order to read their streams as InputStream.
>
> Actually, you don't even need to save the ZipEntry:s in memory, you can just extract filenames from them on the first pass, sort them, then lookup the entries in ZipFile again on the second lap. :) I don't think that's necessary though.
@erikj79 thanks I didn't realize you can do that: "you can use the ZipFile class to access ZipEntry's in arbitrary order"
-------------
PR: https://git.openjdk.java.net/jdk/pull/6311
More information about the build-dev
mailing list