commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/3] commons-compress git commit: two more trivial fixes for Sonar
Date Tue, 20 Dec 2016 13:41:39 GMT
two more trivial fixes for Sonar


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/0c73ea7c
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/0c73ea7c
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/0c73ea7c

Branch: refs/heads/master
Commit: 0c73ea7c62d325bde4612d19cc31b542f36c9457
Parents: a033621
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Tue Dec 20 14:36:38 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Dec 20 14:36:38 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/compress/archivers/dump/TapeInputStream.java    | 2 +-
 .../java/org/apache/commons/compress/archivers/tar/TarUtils.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/0c73ea7c/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java
b/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java
index 834d727..0d6c694 100644
--- a/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java
@@ -185,7 +185,7 @@ class TapeInputStream extends FilterInputStream {
                 n = (long) len - bytes;
             } else {
                 // copy what we can from the buffer.
-                n = blockSize - readOffset;
+                n = (long) blockSize - readOffset;
             }
 
             // do not copy data but still increment counters.

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/0c73ea7c/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
index 9749a2d..f95bbf3 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
@@ -193,7 +193,7 @@ public class TarUtils {
         if (negative) {
             // 2's complement
             val--;
-            val ^= (long) Math.pow(2.0, (length - 1) * 8) - 1;
+            val ^= (long) Math.pow(2.0, (length - 1) * 8.0) - 1;
         }
         return negative ? -val : val;
     }


Mime
View raw message