Skip to content

Commit

Permalink
fix add
Browse files Browse the repository at this point in the history
  • Loading branch information
not-napoleon committed Dec 3, 2024
1 parent fbb2b5f commit a3ce856
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static Iterable<Object[]> parameters() {
};
BiFunction<TestCaseSupplier.TypedData, TestCaseSupplier.TypedData, List<String>> warnings = (lhs, rhs) -> {
try {
addDatesAndTemporalAmount(lhs.data(), rhs.data(), AddTests::addMillis);
addDatesAndTemporalAmount(lhs.getValue(), rhs.getValue(), AddTests::addMillis);
return List.of();
} catch (ArithmeticException e) {
return List.of(
Expand Down Expand Up @@ -332,6 +332,7 @@ private static Object addDatesAndTemporalAmount(Object lhs, Object rhs, ToLongBi
// this weird casting dance makes the expected value lambda symmetric
Instant date;
TemporalAmount period;
assert (lhs instanceof Instant) || (rhs instanceof Instant);
if (lhs instanceof Instant) {
date = (Instant) lhs;
period = (TemporalAmount) rhs;
Expand Down

0 comments on commit a3ce856

Please sign in to comment.