RFR: 8276766: Enable jar and jmod to produce deterministic timestamped content [v4]

Andrew Leonard aleonard at openjdk.java.net
Mon Nov 29 16:22:36 UTC 2021


On Fri, 26 Nov 2021 16:24:31 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> @LanceAndersen java File times can't be before the epoch, but having a test before dostime 1980 would be useful
>
>> 
> 
> The change to sun/tools/jar/GNUStyleOptions.java does not prevent a negative value which can be set via ZipEntry similar to:
> 
>     public void testOfEpochSecond() {
>         var ze = new ZipEntry("test");
>         for(var i =  0; i < 100; i++) {
>             var time = LocalDateTime.ofEpochSecond(-i, 0, ZoneOffset.UTC);
>             ze.setTimeLocal(time);
>             System.out.printf(
>                     "time= %s, Zip Entry time= %s%n", time, ze.getTimeLocal());
>         }
>     }
> 
> If the intent is to not support dates prior to the Epoch then GNUStyleOptions should throw an Exception in this case.

Added more tests, and negative check

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

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


More information about the compiler-dev mailing list