Reuse own API

This commit is contained in:
Gary Gregory 2022-11-04 16:18:35 -04:00
parent bea5bd3c0a
commit 54e26e04fa
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,8 @@ package org.apache.commons.lang3.time;
import java.util.TimeZone; import java.util.TimeZone;
import org.apache.commons.lang3.ObjectUtils;
/** /**
* Helps to deal with {@link java.util.TimeZone}s. * Helps to deal with {@link java.util.TimeZone}s.
* *
@ -50,7 +52,7 @@ public class TimeZones {
* @since 3.13.0 * @since 3.13.0
*/ */
public static TimeZone toTimeZone(final TimeZone timeZone) { public static TimeZone toTimeZone(final TimeZone timeZone) {
return timeZone != null ? timeZone : TimeZone.getDefault(); return ObjectUtils.getIfNull(timeZone, TimeZone::getDefault);
} }
} }