github-code-scanning[bot] commented on code in PR #12220:
URL: https://github.com/apache/dolphinscheduler/pull/12220#discussion_r983746182
##########
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/utils/DateUtils.java:
##########
@@ -437,4 +437,14 @@
public static String getTimestampString() {
return String.valueOf(System.currentTimeMillis());
}
+
+ /**
+ * transform timestamp to date
+ *
+ * @param timeStamp timeStamp
+ * @return date
+ */
+ public static Date timeStampToLocalDate(long timeStamp) {
+ return timeStamp == 0L ? null : new
Date(Long.parseLong(String.valueOf(timeStamp)));
Review Comment:
## Missing catch of NumberFormatException
Potential uncaught 'java.lang.NumberFormatException'.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/1584)
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DateUtils.java:
##########
@@ -646,4 +646,23 @@
}
+ /**
+ * transform timeStamp to local date
+ *
+ * @param timeStamp time stamp (milliseconds)
+ * @return local date
+ */
+ public static Date timeStampToLocalDate(long timeStamp) {
+ return timeStamp == 0L ? null : new
Date(Long.parseLong(String.valueOf(timeStamp)));
Review Comment:
## Missing catch of NumberFormatException
Potential uncaught 'java.lang.NumberFormatException'.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/1583)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]