Skip to content

Commit c683f14

Browse files
committed
[CODEC-96] Base64 encode() method is no longer thread-safe, breaking clients using it as a shared BinaryEncoder. Make Context ivar final.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1309062 13f79535-47bb-0310-9956-ffa450edef68
1 parent e04ddcf commit c683f14

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/apache/commons/codec/binary/BaseNCodecInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class BaseNCodecInputStream extends FilterInputStream {
3838

3939
private final byte[] singleByte = new byte[1];
4040

41-
private Context context = new Context();
41+
private final Context context = new Context();
4242

4343
protected BaseNCodecInputStream(InputStream in, BaseNCodec baseNCodec, boolean doEncode) {
4444
super(in);

src/main/java/org/apache/commons/codec/binary/BaseNCodecOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class BaseNCodecOutputStream extends FilterOutputStream {
3838

3939
private final byte[] singleByte = new byte[1];
4040

41-
private Context context = new Context();
41+
private final Context context = new Context();
4242

4343
// TODO should this be protected?
4444
public BaseNCodecOutputStream(OutputStream out, BaseNCodec basedCodec, boolean doEncode) {

0 commit comments

Comments
 (0)