You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2013/12/20 15:44:01 UTC

svn commit: r1552685 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/BitStream.java

Author: bodewig
Date: Fri Dec 20 14:44:00 2013
New Revision: 1552685

URL: http://svn.apache.org/r1552685
Log:
make PMD a bit happier

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

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/BitStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/BitStream.java?rev=1552685&r1=1552684&r2=1552685&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/BitStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/BitStream.java Fri Dec 20 14:44:00 2013
@@ -78,10 +78,8 @@ class BitStream {
      * @return The next bit (0 or 1) or -1 if the end of the stream has been reached
      */
     int nextBit() throws IOException {
-        if (bitCacheSize == 0) {
-            if (!fillCache()) {
-                return -1;
-            }
+        if (bitCacheSize == 0 && !fillCache()) {
+            return -1;
         }
 
         int bit = (int) (bitCache & 1); // extract the right most bit
@@ -99,10 +97,8 @@ class BitStream {
      * @return The value formed by the n bits, or -1 if the end of the stream has been reached
      */
     int nextBits(final int n) throws IOException {
-        if (bitCacheSize < n) {
-            if (!fillCache()) {
-                return -1;
-            }
+        if (bitCacheSize < n && !fillCache()) {
+            return -1;
         }
 
         final int bits = (int) (bitCache & MASKS[n]); // extract the right most bits