RFR: 8253952: Refine ZipOutputStream.putNextEntry() to recalculate ZipEntry's compressed size [v3]

Lance Andersen lancea at openjdk.java.net
Mon Oct 12 15:40:20 UTC 2020


On Mon, 12 Oct 2020 12:48:36 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Volker Simonis has refreshed the contents of this pull request, and previous commits have been removed. The incremental
>> views will show differences compared to the previous content of the PR. The pull request contains one new commit since
>> the last revision:
>>   8253952: Refine ZipOutputStream.putNextEntry() to recalculate ZipEntry's compressed size
>
> src/java.base/share/classes/java/util/jar/JarOutputStream.java line 86:
> 
>> 84:      * compressed size will be set to the actual compressed size after
>> 85:      * deflation. The current time will be used if the entry has no set
>> 86:      * modification time.
> 
> Thanks for combining the wording, I think this looks good. I'd probably drop "i.e." so that it's just "DEFLATED"
> parentheses.

I might consider making "The current time..." its own paragraph separate from the compression discussion as I think it
would be clearer that way.

> src/java.base/share/classes/java/util/zip/ZipOutputStream.java line 216:
> 
>> 214:                 e.flag = 8;
>> 215:             }
>> 216:             else if (!e.manual_csize) {
> 
> I assume the existing expression that set if csize has been set so that we don't set the flag to 8 in two branches.

I was thinking about that myself

-------------

PR: https://git.openjdk.java.net/jdk/pull/520



More information about the security-dev mailing list