From 075b3e1a409f685ce412dbea2458990f2dbc699e Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 10 Aug 2023 14:13:19 -0400 Subject: [PATCH] Add invariant check in FastDateParser.appendDisplayNames(Calendar, Locale, int, StringBuilder) --- src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java index 6851a4dc4..a043a1706 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java @@ -488,6 +488,7 @@ public class FastDateParser implements DateParser, Serializable { */ private static Map appendDisplayNames(final Calendar calendar, final Locale locale, final int field, final StringBuilder regex) { + Objects.requireNonNull(calendar, "calendar"); final Map values = new HashMap<>(); final Locale actualLocale = LocaleUtils.toLocale(locale); final Map displayNames = calendar.getDisplayNames(field, Calendar.ALL_STYLES, actualLocale);