Skip to content

Commit

Permalink
After JDK-JDK-8338696, the file birth time never get the epoch (0), s…
Browse files Browse the repository at this point in the history
…o delete the SkippedException for epoch (0)
  • Loading branch information
sendaoYan committed Sep 7, 2024
1 parent 1ca8dd0 commit a931938
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024 Alibaba Group Holding Limited. 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 Down Expand Up @@ -51,8 +52,6 @@

public class CreationTime {

private static final java.io.PrintStream err = System.err;

/**
* Reads the creationTime attribute
*/
Expand All @@ -79,13 +78,8 @@ static void test(Path top) throws IOException {
Instant now = Instant.now();
if (Math.abs(creationTime.toMillis()-now.toEpochMilli()) > 10000L) {
System.out.println("creationTime.toMillis() == " + creationTime.toMillis());
// If the file system doesn't support birth time, then skip this test
if (creationTime.toMillis() == 0) {
throw new SkippedException("birth time not supported for: " + file);
} else {
err.println("File creation time reported as: " + creationTime);
throw new RuntimeException("Expected to be close to: " + now);
}
System.err.println("File creation time reported as: " + creationTime);
throw new RuntimeException("Expected to be close to: " + now);
}

/**
Expand Down

0 comments on commit a931938

Please sign in to comment.