commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/3] commons-compress git commit: make Sonar less unhappy
Date Wed, 08 Feb 2017 17:05:18 GMT
make Sonar less unhappy


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

Branch: refs/heads/master
Commit: 72fec65e1c09e14b92a21aae5d0f0dd20e8fe4ef
Parents: b1e5248
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Wed Feb 8 18:04:53 2017 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Wed Feb 8 18:04:53 2017 +0100

----------------------------------------------------------------------
 .../lz77support/AbstractLZ77CompressorInputStream.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/72fec65e/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
b/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
index 284b79f..13e5331 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz77support/AbstractLZ77CompressorInputStream.java
@@ -224,8 +224,8 @@ public abstract class AbstractLZ77CompressorInputStream extends CompressorInputS
 
     private void tryToReadLiteral(int bytesToRead) throws IOException {
         // min of "what is still inside the literal", "what does the user want" and "how
muc can fit into the buffer"
-        final int reallyTryToRead = (int) Math.min(Math.min(bytesToRead, bytesRemaining),
-                                                   buf.length - writeIndex);
+        final int reallyTryToRead = Math.min((int) Math.min(bytesToRead, bytesRemaining),
+                                             buf.length - writeIndex);
         final int bytesRead = reallyTryToRead > 0
             ? IOUtils.readFully(in, buf, writeIndex, reallyTryToRead)
             : 0 /* happens for bytesRemaining == 0 */;
@@ -285,8 +285,8 @@ public abstract class AbstractLZ77CompressorInputStream extends CompressorInputS
     private void tryToCopy(int bytesToCopy) {
         // this will fit into the buffer without sliding and not
         // require more than is available inside the back-reference
-        int copy = (int) Math.min(Math.min(bytesToCopy, bytesRemaining),
-                                  buf.length - writeIndex);
+        int copy = Math.min((int) Math.min(bytesToCopy, bytesRemaining),
+                            buf.length - writeIndex);
         if (copy == 0) {
             // NOP
         } else if (backReferenceOffset == 1) { // pretty common special case


Mime
View raw message