commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r922334 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Date Fri, 12 Mar 2010 16:48:37 GMT
Author: sebb
Date: Fri Mar 12 16:48:37 2010
New Revision: 922334

URL: http://svn.apache.org/viewvc?rev=922334&view=rev
Log:
Math.signum() is Java 1.5

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java?rev=922334&r1=922333&r2=922334&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Fri Mar 12 16:48:37 2010
@@ -668,7 +668,7 @@ public class ZipFile {
     }
 
     /**
-     * Compares two ZupArchiveEntries based on their offset within the archive.
+     * Compares two ZipArchiveEntries based on their offset within the archive.
      *
      * <p>Won't return any meaningful results if one of the entries
      * isn't part of the archive at all.</p>
@@ -692,7 +692,8 @@ public class ZipFile {
                 if (off2 == null) {
                     return -1;
                 }
-                return (int) Math.signum(off1.headerOffset - off2.headerOffset);
+                long val = (off1.headerOffset - off2.headerOffset);
+                return val == 0 ? 0 : val < 0 ? -1 : +1;
             }
             public boolean equals(Object o) {
                 return o == this;



Mime
View raw message