Code Review Request for two pass signing
Sean Mullan
sean.mullan at oracle.com
Tue Apr 19 07:28:20 PDT 2011
On 04/19/2011 09:21 AM, Alan Bateman wrote:
> Sean Mullan wrote:
>> I have modified the signed module implementation to generate a signed
>> module file in two passes, which avoids the signature length issues
>> mentioned in a previous thread [1].
>>
>> I also enhanced some of the code to use the new JDK 7
>> try-with-resource and multi-catch language features.
>>
>> webrev:
>> http://cr.openjdk.java.net/~mullan/jigsaw/webrevs/twopass-sign/webrev.00/
> Sean - I went through the webrev. The approach make sense to me although
> I think we should put ModuleFileFormat on a list to clean-up at some point.
>
> At L159 and L168 you use transferTo to copy the sections but that method
> may transfer less than requested. I don't think it will for the
> file->file case here (except when there is an error) but just mentioning
> it.
Right, but the code throws an IOException if the number of bytes
transferred is not equal to what was requested (the 2nd argument). Are
you suggesting it would be more accurate to use '<' since the method can
never transfer more than requested?
> At L176 I assume this should be Files.delete(f.toPath()) as I assume it
> doesn't compile as is.
This is calling the org.openjdk.jigsaw.Files.delete() utility method.
Should I use java.nio.files.Files.delete() instead? We should really
change the name of that class to avoid clashes with the
java.nio.file.Files class.
> I see you've changed many existing places to use try-with-resources
> (which is good) and one thing we could do too is replace most of these
> places with Files.copy.
Ok, more cleanup activity for a later time.
--Sean
More information about the jigsaw-dev
mailing list