RFR: 8330533: JFR: LocalDateTime should not use milliseconds since epoch

Andrey Turbanov aturbanov at openjdk.org
Thu Apr 18 08:04:07 UTC 2024


On Wed, 17 Apr 2024 20:37:19 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

> Could I have a review of a bug fix that changes the parameter passed to LocalDateTime to an Instant.
> 
> Testing: jdk/jdk/jfr + manual inspection of -Xlog:jfr to ensure filenames use UTC when an incorrect time zone is used.
> 
> Thanks
> Erik

src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java line 113:

> 111:         } catch (DateTimeException d) {
> 112:             Logger.log(LogTag.JFR, LogLevel.INFO, "Could not create LocalDateTime with the default time zone. Using UTC time zone for chunk filename.");
> 113:             return LocalDateTime.ofInstant(Instant.now(), ZoneOffset.UTC);

Can we simplify to `LocalDateTime.now(ZoneOffset.UTC)` ?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18827#discussion_r1570209638


More information about the hotspot-jfr-dev mailing list