Skip to content
Permalink
Browse files
8277422: tools/jar/JarEntryTime.java fails with modified time mismatch
Backport-of: ad1ff27b730773a141d73744e5f5a899bdfbea78
  • Loading branch information
GoeLin committed Mar 18, 2022
1 parent dfcef29 commit dbd14f7b2c023200e6d8c9ec3a7a8f07a3ea9613
Showing 1 changed file with 11 additions and 2 deletions.
@@ -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,14 +23,15 @@

/**
* @test
* @bug 4225317 6969651
* @bug 4225317 6969651 8277422
* @modules jdk.jartool
* @summary Check extracted files have date as per those in the .jar file
*/

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 static void realMain(String[] args) throws Throwable {
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/

1 comment on commit dbd14f7

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on dbd14f7 Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.