Review request: Install module content into zip files

Dalibor Topic Dalibor.Topic at Sun.COM
Fri May 21 07:01:39 PDT 2010


Mark Reinhold wrote:
> http://cr.openjdk.java.net/~mr/jigsaw/rev/zip-module-content/
> 
> This change causes a module's classes and resources to be stored in zip
> files within the target library, regardless of whether the module came
> from a .jmod file or from explicit class and resource trees.
> 
> This will help performance a tiny bit on some platforms and a small bit
> on others.  It's also a prelude to an even more-efficient library format,
> which will store zip-file offsets directly in module configuration files
> so that we never have to read zip-file directories.

Nice, I like the extensions to Files, in particular, and the cleanup in
ModuleFileFormat. Small comments:

ModuleFileFormat.java:

 632         public void readUncompressedFile(DataInputStream in,
 633                                          ModuleFile.SectionType type,
 634                                          int csize)
 635             throws IOException
 636         {
 637             assert type != ModuleFile.SectionType.MODULE_INFO;

-> this assert is gone in the patch. I'm not sure why, as the only
uncompressed format atm is the module info file.

 730         private void unpack200gzip(DataInputStream in) throws
IOException {
[..]
735             unpacker.unpack(gis, contentStream());

doesn't close the content stream.

Files.java:

Nice. A few things I could use would be:

1) a public void copy(InputStream, OutputStream) would be useful for
replacing the various bits in ModuleFileFormat doing the same thing.

2) It would be nice if the copy methods returned the number of bytes
copied. Same for storeTree -> that would make it easy to use those
methods during module file writing to get the usize right.

cheers,
dalibor topic

-- 
*******************************************************************
Dalibor Topic 			Tel: (+49 40) 23 646 738
Java F/OSS Ambassador 		AIM: robiladonaim
Sun Microsystems GmbH 		Mobile: (+49 177) 2664 192
Nagelsweg 55 			http://openjdk.java.net
D-20097 Hamburg 		mailto:Dalibor.Topic at sun.com
Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Jürgen Kunz



More information about the jigsaw-dev mailing list