This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit 19bb1933490cd315d2cb739661c6d5bca6e56624 Author: Gary Gregory <[email protected]> AuthorDate: Mon Apr 15 18:07:01 2024 -0400 Refactor instance variables that act like temps into locals --- src/main/java/org/apache/commons/codec/binary/Base64.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/codec/binary/Base64.java b/src/main/java/org/apache/commons/codec/binary/Base64.java index 79b31721..775a75a7 100644 --- a/src/main/java/org/apache/commons/codec/binary/Base64.java +++ b/src/main/java/org/apache/commons/codec/binary/Base64.java @@ -433,12 +433,6 @@ public class Base64 extends BaseNCodec { */ private final byte[] lineSeparator; - /** - * Convenience variable to help us determine when our buffer is going to run out of room and needs resizing. - * {@code decodeSize = 3 + lineSeparator.length;} - */ - private final int decodeSize; - /** * Convenience variable to help us determine when our buffer is going to run out of room and needs resizing. * {@code encodeSize = 4 + lineSeparator.length;} @@ -665,7 +659,6 @@ public class Base64 extends BaseNCodec { this.encodeSize = BYTES_PER_ENCODED_BLOCK; this.lineSeparator = null; } - this.decodeSize = this.encodeSize - 1; } // Implementation of the Encoder Interface @@ -718,6 +711,7 @@ public class Base64 extends BaseNCodec { if (inAvail < 0) { context.eof = true; } + final int decodeSize = this.encodeSize - 1; for (int i = 0; i < inAvail; i++) { final byte[] buffer = ensureBufferSize(decodeSize, context); final byte b = input[inPos++];
