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:47 UTC

(commons-compress) branch master updated (17b60d728 -> 38bc9718b)

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

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


    from 17b60d728 Fix weird test method names
     new b19f7346b Internal refactoring
     new 38bc9718b Comments

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/apache/commons/compress/utils/TimeUtils.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)


(commons-compress) 02/02: Comments

Posted by gg...@apache.org.
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 38bc9718b22eb19d0886608594a1f34f37f52736
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Dec 22 15:53:42 2023 -0500

    Comments
---
 src/main/java/org/apache/commons/compress/utils/TimeUtils.java | 3 +++
 1 file changed, 3 insertions(+)

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 c949c26eb..4d5917bcf 100644
--- a/src/main/java/org/apache/commons/compress/utils/TimeUtils.java
+++ b/src/main/java/org/apache/commons/compress/utils/TimeUtils.java
@@ -62,6 +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) {
+        // TODO Apache Commons IO 2.16.0
         return isUnixTime(toUnixTime(time));
     }
 
@@ -72,6 +73,7 @@ public final class TimeUtils {
      * @return true if the time can be represented in the standard UNIX time, false otherwise.
      */
     public static boolean isUnixTime(final long seconds) {
+        // TODO Apache Commons IO 2.16.0
         return Integer.MIN_VALUE <= seconds && seconds <= Integer.MAX_VALUE;
     }
 
@@ -170,6 +172,7 @@ public final class TimeUtils {
      * @return the UNIX timestamp.
      */
     public static long toUnixTime(final FileTime fileTime) {
+        // TODO Apache Commons IO 2.16.0
         return fileTime != null ? fileTime.to(TimeUnit.SECONDS) : 0;
     }
 


(commons-compress) 01/02: Internal refactoring

Posted by gg...@apache.org.
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;
     }
 
     /**