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 35a4b36457..47fd62e0e7 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 9c1b291dfe..6407a91a5f 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() {