Modular JAR file support

David Schlosnagle schlosna at gmail.com
Tue Apr 5 18:28:33 PDT 2011


On Tue, Apr 5, 2011 at 6:46 PM, Mandy Chung <mandy.chung at oracle.com> wrote:
> Webrev at:
>    http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/modular-jar-file/

Mandy,

I have a small comment about SimpleLibrary.java:
 965     private ModuleId installFromJarFile(File mf,  boolean verifySignature)
 966         throws ConfigurationException, IOException, SignatureException
 967     {
 968         JarFile jf = new JarFile(mf, verifySignature);
                     ^^ It doesn't look like this JarFile is ever closed (the
                        input streams from the JAR do seem to be closed, but I
                        think this could leak file descriptors). It seems this
                        would be a fine use of try-with-resources:

    private ModuleId installFromJarFile(File mf,  boolean verifySignature)
        throws ConfigurationException, IOException, SignatureException
    {
        File md = null;
        try (JarFile jf = new JarFile(mf, verifySignature)) {

- Dave



More information about the jigsaw-dev mailing list