From 54e26e04fa71cc983c252f15eb2baf0adaaf4d65 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 4 Nov 2022 16:18:35 -0400 Subject: [PATCH] Reuse own API --- src/main/java/org/apache/commons/lang3/time/TimeZones.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/time/TimeZones.java b/src/main/java/org/apache/commons/lang3/time/TimeZones.java index 770e1cc70..c9fa4b24f 100644 --- a/src/main/java/org/apache/commons/lang3/time/TimeZones.java +++ b/src/main/java/org/apache/commons/lang3/time/TimeZones.java @@ -19,6 +19,8 @@ package org.apache.commons.lang3.time; import java.util.TimeZone; +import org.apache.commons.lang3.ObjectUtils; + /** * Helps to deal with {@link java.util.TimeZone}s. * @@ -50,7 +52,7 @@ public class TimeZones { * @since 3.13.0 */ public static TimeZone toTimeZone(final TimeZone timeZone) { - return timeZone != null ? timeZone : TimeZone.getDefault(); + return ObjectUtils.getIfNull(timeZone, TimeZone::getDefault); } }