8277422: tools/jar/JarEntryTime.java fails with modified time mismatch

Reviewed-by: joehw, msheppar, naoto
This commit is contained in:
Lance Andersen 2021-12-02 16:33:32 +00:00
parent 7c4ef3abaf
commit ad1ff27b73

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/**
* @test
* @bug 4225317 6969651
* @bug 4225317 6969651 8277422
* @modules jdk.jartool
* @summary Check extracted files have date as per those in the .jar file
*/
@ -31,6 +31,7 @@
import java.io.File;
import java.io.PrintWriter;
import java.nio.file.attribute.FileTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.TimeZone;
import java.util.spi.ToolProvider;
@ -93,6 +94,14 @@ public class JarEntryTime {
jarFile.delete();
testFile.delete();
var date = new Date();
var defZone = ZoneId.systemDefault();
if (defZone.getRules().getTransition(
date.toInstant().atZone(defZone).toLocalDateTime()) != null) {
System.out.println("At the offset transition. JarEntryTime test skipped.");
return;
}
/* Create a directory structure
* outer/
* inner/