commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1064428 - in /commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary: Base32.java Base64.java
Date Fri, 28 Jan 2011 02:21:50 GMT
Author: sebb
Date: Fri Jan 28 02:21:49 2011
New Revision: 1064428

URL: http://svn.apache.org/viewvc?rev=1064428&view=rev
Log:
FindBugs - don't assign modulus twice

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base32.java
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base32.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base32.java?rev=1064428&r1=1064427&r2=1064428&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base32.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base32.java Fri Jan
28 02:21:49 2011
@@ -344,7 +344,7 @@ public class Base32 extends BaseNCodec {
         } else {
             for (int i = 0; i < inAvail; i++) {
                 ensureBufferSize(encodeSize);
-                modulus = (++modulus) % BYTES_PER_UNENCODED_BLOCK;
+                modulus = (modulus+1) % BYTES_PER_UNENCODED_BLOCK;
                 int b = in[inPos++];
                 if (b < 0) {
                     b += 256;
@@ -409,7 +409,7 @@ public class Base32 extends BaseNCodec {
                 if (b >= 0 && b < this.decodeTable.length) {
                     int result = this.decodeTable[b];
                     if (result >= 0) {
-                        modulus = (++modulus) % BYTES_PER_ENCODED_BLOCK;
+                        modulus = (modulus+1) % BYTES_PER_ENCODED_BLOCK;
                         bitWorkArea = (bitWorkArea << BITS_PER_ENCODED_BYTE) + result;
// collect decoded bytes
                         if (modulus == 0) { // we can output the 5 bytes
                             buffer[pos++] = (byte) ((bitWorkArea >> 32) & MASK_8BITS);

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java?rev=1064428&r1=1064427&r2=1064428&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java Fri Jan
28 02:21:49 2011
@@ -363,7 +363,7 @@ public class Base64 extends BaseNCodec {
         } else {
             for (int i = 0; i < inAvail; i++) {
                 ensureBufferSize(encodeSize);
-                modulus = (++modulus) % BYTES_PER_UNENCODED_BLOCK;
+                modulus = (modulus+1) % BYTES_PER_UNENCODED_BLOCK;
                 int b = in[inPos++];
                 if (b < 0) {
                     b += 256;
@@ -426,7 +426,7 @@ public class Base64 extends BaseNCodec {
                 if (b >= 0 && b < DECODE_TABLE.length) {
                     int result = DECODE_TABLE[b];
                     if (result >= 0) {
-                        modulus = (++modulus) % BYTES_PER_ENCODED_BLOCK;
+                        modulus = (modulus+1) % BYTES_PER_ENCODED_BLOCK;
                         bitWorkArea = (bitWorkArea << BITS_PER_ENCODED_BYTE) + result;
                         if (modulus == 0) {
                             buffer[pos++] = (byte) ((bitWorkArea >> 16) & MASK_8BITS);



Mime
View raw message