Modular JAR file support

Mandy Chung mandy.chung at oracle.com
Tue Apr 5 18:55:26 PDT 2011


  On 4/5/11 6:28 PM, David Schlosnagle wrote:
> 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)) {

You're right.  I missed closing of the JarFile.  Thanks for catching it 
and will fix it.

Mandy




More information about the jigsaw-dev mailing list