RFR: Superfluous classes archive created for modules with no files

Chris Hegarty chris.hegarty at oracle.com
Wed Feb 15 06:09:59 PST 2012



On 15/02/2012 12:23, Alan Bateman wrote:
> ...
> Is this causing a problem or is it just the warning from unzip? I
> remember Dave Bristor pushed several changes to ensure that the empty
> zip case was handled and I'm just wondering if something was missed.

This causes a problem. The assert is fired.

I noticed this issue while working on creating the module images from 
jmod files ( I hope to publish a webrev for this later in the week ). It 
is an obvious difference between the images created by installing from 
"classes", rather than jmod files, and causes the resource test to fail 
(since jdk and jdk.jre will not have a classes archive when installed 
from jmod file).

> As regards the change then I think listFiles would be nicer if it
> returned a List<Path> rather than populated the given collection, ie:
> List<Path> files = listAll(src.toPath());
>
> What would you about removing Files.copy(File,OutputStream) from
> org.openjdk.jigsaw.Files and using
> java.nio.file.Files.copy(Path,OutputStream). That would avoid some of
> the conversion in this case. One difference to be aware of is that
> Files.copy(Path,OutputStream) does not close the output stream. The
> rational for this is for the "cat f1 f2 f2 > out" type case.
>
> Minor comment is just to check that the style is consistent (indentation
> of "throws IOException" and use of curly braces with single statements).

Updated webrev incorporating the above comments:

   http://cr.openjdk.java.net/~chegar/jigsaw/classless_webrev.01/webrev/

-Chris.

>
> -Alan.
>
>
>
>
>
>
>
>
>



More information about the jigsaw-dev mailing list