Review Request: JDK-8166860 Add magic number to jmod file

Mandy Chung mandy.chung at
Thu Sep 29 15:26:44 UTC 2016

> On Sep 29, 2016, at 7:07 AM, Alan Bateman <Alan.Bateman at> wrote:
> I think I agree on keep out of the ZipFile internals. As you noted, this is just packaging and link time so it's not a magic issue if the file is opened twice (assuming the file system isn't changing under your feet of course).
> A minor comment on JmodOutputStream is that the newOutputStream description should be clearer to say that it creates (or overrides) the JMOD file, returning the the output stream to write to the JMOD. You might want to check the indentation of the throws in the writeEntry methods as it's hard to see where the method body starts.

The indentation was fine.  I updated the comment and have a line-break before the open curly bracket.

> JmodFile::stream - I wonder if it would be better to leave the filtering at the use sites.

I believe we don’t create an empty directory in the custom image and so all entries can simply be considered for file only.  Perhaps we can change this (very simple change) when there is such need?

> In ModuleInfoExtender then toByteArray might be nicer than getBytes.

toByteArray is better.

Updated webrev:


More information about the jigsaw-dev mailing list