You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/22 20:53:48 UTC

(commons-compress) 01/02: Internal refactoring

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit b19f7346bc4d7b7c04017489689b631c05c4bc6c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Dec 22 15:52:11 2023 -0500

    Internal refactoring
---
 src/main/java/org/apache/commons/compress/utils/TimeUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/compress/utils/TimeUtils.java b/src/main/java/org/apache/commons/compress/utils/TimeUtils.java
index 22bd925b7..c949c26eb 100644
--- a/src/main/java/org/apache/commons/compress/utils/TimeUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/TimeUtils.java
@@ -62,7 +62,7 @@ public final class TimeUtils {
      * @return true if the time exceeds the minimum or maximum UNIX time, false otherwise.
      */
     public static boolean isUnixTime(final FileTime time) {
-        return time == null ? true : isUnixTime(toUnixTime(time));
+        return isUnixTime(toUnixTime(time));
     }
 
     /**
@@ -170,7 +170,7 @@ public final class TimeUtils {
      * @return the UNIX timestamp.
      */
     public static long toUnixTime(final FileTime fileTime) {
-        return fileTime.to(TimeUnit.SECONDS);
+        return fileTime != null ? fileTime.to(TimeUnit.SECONDS) : 0;
     }
 
     /**