Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk13u-dev Public archive

Commit

Permalink
8277422: tools/jar/JarEntryTime.java fails with modified time mismatch
Browse files Browse the repository at this point in the history
Backport-of: ad1ff27b730773a141d73744e5f5a899bdfbea78
  • Loading branch information
Yuri Nesterenko committed Jul 22, 2022
1 parent 7f63e9a commit 88e7d24
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/jdk/tools/jar/JarEntryTime.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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/
Expand Down

1 comment on commit 88e7d24

@openjdk-notifier
Copy link

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.