Skip to content

Commit 6730f26

Browse files
fixed pmd failure
1 parent a3e0975 commit 6730f26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/thealgorithms/maths/ZellersCongruence.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.time.DateTimeException;
44
import java.time.LocalDate;
5+
import java.util.Objects;
56

67
/**
78
* A utility class for calculating the day of the week for a given date using Zeller's Congruence.
@@ -49,7 +50,7 @@ public static String calculateDay(String input) {
4950
int year = parsePart(input.substring(6, 10), 46, 8499, "Year must be between 46 and 8499.");
5051

5152
try {
52-
LocalDate.of(year, month, day);
53+
Objects.requireNonNull(LocalDate.of(year, month, day));
5354
} catch (DateTimeException e) {
5455
throw new IllegalArgumentException("Invalid date.", e);
5556
}

0 commit comments

Comments
 (0)