From 371272217f039b71b1c9def1f7b415b4f5e1d066 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Fri, 4 Nov 2022 05:29:04 +0100 Subject: [PATCH] Swap things --- .../picnic/errorprone/refasterrules/TimeRules.java | 8 ++++---- .../errorprone/refasterrules/TimeRulesTestInput.java | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java index 35a4b36457e..47fd62e0e7e 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/TimeRules.java @@ -72,8 +72,8 @@ static final class LocalDateOfInstant { LocalDate before(Instant instant, ZoneId zoneId) { return Refaster.anyOf( instant.atZone(zoneId).toLocalDate(), - OffsetDateTime.ofInstant(instant, zoneId).toLocalDate(), - LocalDateTime.ofInstant(instant, zoneId).toLocalDate()); + LocalDateTime.ofInstant(instant, zoneId).toLocalDate(), + OffsetDateTime.ofInstant(instant, zoneId).toLocalDate()); } @BeforeTemplate @@ -113,9 +113,9 @@ static final class LocalTimeOfInstant { LocalTime before(Instant instant, ZoneId zoneId) { return Refaster.anyOf( instant.atZone(zoneId).toLocalTime(), + LocalDateTime.ofInstant(instant, zoneId).toLocalTime(), OffsetDateTime.ofInstant(instant, zoneId).toLocalTime(), - OffsetTime.ofInstant(instant, zoneId).toLocalTime(), - LocalDateTime.ofInstant(instant, zoneId).toLocalTime()); + OffsetTime.ofInstant(instant, zoneId).toLocalTime()); } @BeforeTemplate diff --git a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java index 9c1b291dfe9..6407a91a5f0 100644 --- a/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java +++ b/error-prone-contrib/src/test/resources/tech/picnic/errorprone/refasterrules/TimeRulesTestInput.java @@ -40,8 +40,8 @@ ImmutableSet testLocalDateOfInstant() { return ImmutableSet.of( Instant.EPOCH.atZone(ZoneId.of("Europe/Amsterdam")).toLocalDate(), Instant.EPOCH.atOffset(ZoneOffset.UTC).toLocalDate(), - OffsetDateTime.ofInstant(Instant.EPOCH, ZoneId.of("Europe/Berlin")).toLocalDate(), - LocalDateTime.ofInstant(Instant.EPOCH, ZoneOffset.MIN).toLocalDate()); + LocalDateTime.ofInstant(Instant.EPOCH, ZoneId.of("Europe/Berlin")).toLocalDate(), + OffsetDateTime.ofInstant(Instant.EPOCH, ZoneOffset.MIN).toLocalDate()); } ImmutableSet testLocalDateTimeOfInstant() { @@ -55,9 +55,9 @@ ImmutableSet testLocalTimeOfInstant() { return ImmutableSet.of( Instant.EPOCH.atZone(ZoneId.of("Europe/Amsterdam")).toLocalTime(), Instant.EPOCH.atOffset(ZoneOffset.UTC).toLocalTime(), - OffsetDateTime.ofInstant(Instant.EPOCH, ZoneId.of("Europe/Berlin")).toLocalTime(), - OffsetTime.ofInstant(Instant.EPOCH, ZoneOffset.MIN).toLocalTime(), - LocalDateTime.ofInstant(Instant.EPOCH, ZoneOffset.MAX).toLocalTime()); + LocalDateTime.ofInstant(Instant.EPOCH, ZoneId.of("Europe/Berlin")).toLocalTime(), + OffsetDateTime.ofInstant(Instant.EPOCH, ZoneOffset.MIN).toLocalTime(), + OffsetTime.ofInstant(Instant.EPOCH, ZoneOffset.MAX).toLocalTime()); } OffsetDateTime testOffsetDateTimeOfInstant() {