Skip to content

Commit 1b586c8

Browse files
committed
Adapt to work with 17
1 parent 22a5962 commit 1b586c8

File tree

1 file changed

+2
-2
lines changed
  • test/jdk/tools/jpackage/helpers/jdk/jpackage/test

1 file changed

+2
-2
lines changed

test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ public static void waitForFileCreated(Path fileToWaitFor,
526526
Duration timeout, Duration afterCreatedTimeout) throws IOException {
527527
waitForFileCreated(fileToWaitFor, timeout);
528528
// Wait after the file has been created to ensure it is fully written.
529-
ThrowingConsumer.<Duration>toConsumer(Thread::sleep).accept(afterCreatedTimeout);
529+
ThrowingConsumer.<Long>toConsumer(Thread::sleep).accept(afterCreatedTimeout.getSeconds());
530530
}
531531

532532
private static void waitForFileCreated(Path fileToWaitFor, Duration timeout) throws IOException {
@@ -543,7 +543,7 @@ private static void waitForFileCreated(Path fileToWaitFor, Duration timeout) thr
543543
for (;;) {
544544
Instant n = Instant.now();
545545
Duration remainderTimeout = Duration.between(n, waitUntil);
546-
assertTrue(remainderTimeout.isPositive(), String.format(
546+
assertTrue(!remainderTimeout.isNegative() && !remainderTimeout.isZero(), String.format(
547547
"Check timeout value %dms is positive", remainderTimeout.toMillis()));
548548

549549
WatchKey key = ThrowingSupplier.toSupplier(() -> {

0 commit comments

Comments
 (0)