8266846: Add java.time.InstantSource

Reviewed-by: rriggs, naoto, darcy
This commit is contained in:
Stephen Colebourne 2021-06-05 13:26:52 +00:00 committed by Roger Riggs
parent 7f55dc1576
commit 6c838c568c
6 changed files with 559 additions and 87 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@ -272,7 +272,7 @@ public final class Instant
* @return the current instant using the system clock, not null
*/
public static Instant now() {
return Clock.systemUTC().instant();
return Clock.currentInstant();
}
/**