This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 35d5bcd33e6d56fd522263f14bc649cddce144ef
Author: XiaoxiangYu <x...@apache.org>
AuthorDate: Wed Apr 19 17:54:36 2023 +0800

    Fix NPE for six UTs
---
 .../src/main/java/org/apache/kylin/common/util/DateFormat.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/src/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java 
b/src/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
index f3d31dd835..c70edf46d2 100644
--- a/src/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
+++ b/src/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
@@ -131,6 +131,9 @@ public class DateFormat {
     }
 
     public static FastDateFormat getDateFormat(String datePattern, TimeZone 
timeZone) {
+        if(timeZone == null){
+            timeZone = TimeZone.getDefault();
+        }
         String key = datePattern + timeZone.getID();
         FastDateFormat r = formatMap.get(key);
         if (r == null) {
@@ -179,7 +182,7 @@ public class DateFormat {
     }
 
     public static String castTimestampToString(long millis) {
-        return castTimestampToString(millis, null);
+        return castTimestampToString(millis, TimeZone.getDefault());
     }
 
     public static String formatToTimeStr(long millis, String pattern) {

Reply via email to