Skip to content

Commit

Permalink
Bullet-proof internals
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Apr 20, 2024
1 parent d2215d5 commit c56b956
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/apache/commons/codec/binary/Base16.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.commons.codec.binary;

import java.util.Objects;

import org.apache.commons.codec.CodecPolicy;

/**
Expand Down Expand Up @@ -138,6 +140,7 @@ public Base16(final boolean lowerCase) {
*/
private Base16(final boolean lowerCase, final byte[] encodeTable, final CodecPolicy decodingPolicy) {
super(BYTES_PER_UNENCODED_BLOCK, BYTES_PER_ENCODED_BLOCK, 0, 0, PAD_DEFAULT, decodingPolicy);
Objects.requireNonNull(encodeTable, "encodeTable");
this.encodeTable = encodeTable;
this.decodeTable = encodeTable == LOWER_CASE_ENCODE_TABLE ? LOWER_CASE_DECODE_TABLE : UPPER_CASE_DECODE_TABLE;
}
Expand Down

0 comments on commit c56b956

Please sign in to comment.