On Fri, 26 Nov 2021 16:24:31 GMT, Lance Andersen <lan...@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