Skip to content

Commit

Permalink
Remove redundant call to ZonedDateTime#from in JsonHelperBasicsTest
Browse files Browse the repository at this point in the history
The object returned by atZoneSameInstant is a ZonedDateTime, so
wrapping with ZonedDateTime#from is unnecessary.
  • Loading branch information
sleberknight committed Dec 24, 2024
1 parent 2971a72 commit 8b3d545
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ private Foo newFoo(Instant instant) {
var timestamp = Timestamp.from(instant);
var utcZoneId = ZoneId.of("UTC").normalized();
var localDT = LocalDateTime.ofInstant(instant, utcZoneId);
var zonedDT = ZonedDateTime.from(instant.atOffset(ZoneOffset.of("Z")).atZoneSameInstant(utcZoneId));
var zonedDT = instant.atOffset(ZoneOffset.of("Z")).atZoneSameInstant(utcZoneId);
var duration = Duration.ofMinutes(1);

return new Foo(instant, date, timestamp, localDT, zonedDT, duration);
Expand Down

0 comments on commit 8b3d545

Please sign in to comment.