jdk9/10 reject zip/jar files where seconds value of timestamp is out of supported range 0 - 59

Claes Redestad claes.redestad at oracle.com
Mon Oct 9 18:09:12 UTC 2017



On 2017-10-09 18:22, Xueming Shen wrote:
> can some arithmetic calculations + if-else make the cost smaller? not 
> sure
> though.
>
> jshell> ((month - 1) | (12- month) | (day - 1) | (31-day) | (24 - hr) 
> | (59 - min) | (59 - sec)) < 0
> $10 ==> false

Possibly, but given it took almost two years for issues with the unexpected
strictness to be reported then I think we should favor not penalizing
well-formed entries over optimizing for malformed files.

I guess the special treatment for cases where the date part is zero
(time >> 16 == 0) might be common enough to warrant some special
treatment, though.

/Claes


More information about the core-libs-dev mailing list