From 302d697f9b8eff0cd453626dd57b467ed9650061 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Tue, 10 Jan 2023 11:25:31 -0500 Subject: [PATCH] Pick up maven-javadoc-plugin version from parent POM --- pom.xml | 1 - .../java/org/apache/commons/lang3/time/DateFormatUtils.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 49fb26021..b866cf67e 100644 --- a/pom.xml +++ b/pom.xml @@ -634,7 +634,6 @@ 1.36 benchmarks - 3.4.1 0.16.0 3.19.0 6.52.0 diff --git a/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java index 1688c31e4..bc80d907e 100644 --- a/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java @@ -21,6 +21,8 @@ import java.util.Date; import java.util.Locale; import java.util.TimeZone; +import org.apache.commons.lang3.ObjectUtils; + /** * Date and time formatting utilities and constants. * @@ -409,7 +411,7 @@ public class DateFormatUtils { } private static TimeZone getTimeZone(final Calendar calendar) { - return calendar == null ? null : calendar.getTimeZone(); + return ObjectUtils.get(calendar, Calendar::getTimeZone); } }