Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ o Bump checkstyle from 8.45.1 to 9.2.1 #97, #100, #101. Thanks to De


For complete information on Apache Commons Codec, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Apache Commons Codec website:
patches, or suggestions for improvement, see the Apache Commons Codec website:

https://commons.apache.org/proper/commons-codec/

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ limitations under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<!-- Specify source for JDK 11+ javadoc tool to ignore the 'unamed' module.
<!-- Specify source for JDK 11+ javadoc tool to ignore the 'unnamed' module.
See: https://bugs.openjdk.java.net/browse/JDK-8212233.
To be removed with parent 49. -->
<plugin>
Expand Down
6 changes: 3 additions & 3 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ The <action> type attribute can be add,update,fix,remove.
</release>
<release version="1.4" date="9 August 2009" description="Feature and fix release. Requires a minimum of Java 1.4.">
<action dev="ggregory" type="fix" issue="CODEC-80" due-to="Julius Davies">
Regression: Base64.encode(chunk=true) has bug when input length is multiple of 76.
Regression: Base64.encode(chunk=true) has a bug when input length is multiple of 76.
</action>
<action dev="ggregory" type="fix" issue="CODEC-77" due-to="Julius Davies">
Base64 bug with empty input (new byte[0]).
Expand Down Expand Up @@ -411,7 +411,7 @@ The <action> type attribute can be add,update,fix,remove.
Double Metaphone bugs in alternative encoding.
</action>
<action dev="ggregory" type="fix" issue="CODEC-73" due-to="Benjamin Bentmann">
Make string2byte conversions indepedent of platform default encoding.
Make string2byte conversions independent of platform default encoding.
</action>
</release>
<release version="1.3" date="10 July 2004" description="Feature and fix release.">
Expand Down Expand Up @@ -439,7 +439,7 @@ The <action> type attribute can be add,update,fix,remove.
RefinedSoundex: Implemented the DIFFERENCE algorithm.
</action>
<action dev="ggregory" type="update">
This version is relesed under the
This version is released under the
&lt;a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0&lt;/a>
, please see LICENSE.txt. Previous versions were released under the
&lt;a href="http://www.apache.org/licenses/LICENSE-1.1">Apache License 1.1&lt;/a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
* Thrown when there is a failure condition during the encoding process. This exception is thrown when an
* {@link Encoder} encounters a encoding specific exception such as invalid data, inability to calculate a checksum,
* {@link Encoder} encounters an encoding specific exception such as invalid data, inability to calculate a checksum,
* characters outside of the expected range.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/codec/binary/Base16.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void encode(final byte[] data, final int offset, final int length, final Context
*
* @param octet The value to test.
*
* @return {@code true} if the value is defined in the the Base16 alphabet {@code false} otherwise.
* @return {@code true} if the value is defined in the Base16 alphabet {@code false} otherwise.
*/
@Override
public boolean isInAlphabet(final byte octet) {
Expand Down
18 changes: 6 additions & 12 deletions src/main/java/org/apache/commons/codec/binary/Base32.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ public class Base32 extends BaseNCodec {
// The private member fields below are used with the new streaming approach, which requires
// some state be preserved between calls of encode() and decode().

/**
* Place holder for the bytes we're dealing with for our based logic.
* Bitwise operations store and extract the encoding or decoding from this variable.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: check out in git history if there was a variable below this comment before, or if this comment was intended for a block of variables?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was for bitWorkAread6f305d

That field was removed in CODEC-96, so safe to remove this comment now 🕵️ — 3f41cf1


/**
* Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
* {@code decodeSize = {@link #BYTES_PER_ENCODED_BLOCK} - 1 + lineSeparator.length;}
Expand Down Expand Up @@ -161,7 +156,6 @@ public class Base32 extends BaseNCodec {
* <p>
* When encoding the line length is 0 (no chunking).
* </p>
*
*/
public Base32() {
this(false);
Expand Down Expand Up @@ -208,7 +202,7 @@ public Base32(final byte pad) {
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
*/
Expand All @@ -226,7 +220,7 @@ public Base32(final int lineLength) {
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand All @@ -248,7 +242,7 @@ public Base32(final int lineLength, final byte[] lineSeparator) {
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand All @@ -273,7 +267,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand All @@ -299,7 +293,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand Down Expand Up @@ -580,7 +574,7 @@ void encode(final byte[] input, int inPos, final int inAvail, final Context cont
*
* @param octet
* The value to test
* @return {@code true} if the value is defined in the the Base32 alphabet {@code false} otherwise.
* @return {@code true} if the value is defined in the Base32 alphabet {@code false} otherwise.
*/
@Override
public boolean isInAlphabet(final byte octet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public Base32InputStream(final InputStream in, final boolean doEncode) {
* true if we should encode all data read from us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
Expand All @@ -108,8 +108,8 @@ public Base32InputStream(final InputStream input, final boolean doEncode,
* true if we should encode all data read from us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,44 +85,44 @@ public Base32OutputStream(final OutputStream out, final boolean doEncode) {
* Creates a Base32OutputStream such that all data written is either Base32-encoded or Base32-decoded to the
* original provided OutputStream.
*
* @param ouput
* @param output
* OutputStream to wrap.
* @param doEncode
* true if we should encode all data written to us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
*/
public Base32OutputStream(final OutputStream ouput, final boolean doEncode,
public Base32OutputStream(final OutputStream output, final boolean doEncode,
final int lineLength, final byte[] lineSeparator) {
super(ouput, new Base32(lineLength, lineSeparator), doEncode);
super(output, new Base32(lineLength, lineSeparator), doEncode);
}

/**
* Creates a Base32OutputStream such that all data written is either Base32-encoded or Base32-decoded to the
* original provided OutputStream.
*
* @param ouput
* @param output
* OutputStream to wrap.
* @param doEncode
* true if we should encode all data written to us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
* @param decodingPolicy The decoding policy.
* @since 1.15
*/
public Base32OutputStream(final OutputStream ouput, final boolean doEncode,
public Base32OutputStream(final OutputStream output, final boolean doEncode,
final int lineLength, final byte[] lineSeparator, final CodecPolicy decodingPolicy) {
super(ouput, new Base32(lineLength, lineSeparator, false, BaseNCodec.PAD_DEFAULT, decodingPolicy), doEncode);
super(output, new Base32(lineLength, lineSeparator, false, BaseNCodec.PAD_DEFAULT, decodingPolicy), doEncode);
}

}
12 changes: 6 additions & 6 deletions src/main/java/org/apache/commons/codec/binary/Base64.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public static boolean isArrayByteBase64(final byte[] arrayOctet) {
*
* @param octet
* The value to test
* @return {@code true} if the value is defined in the the base 64 alphabet, {@code false} otherwise.
* @return {@code true} if the value is defined in the base 64 alphabet, {@code false} otherwise.
* @since 1.4
*/
public static boolean isBase64(final byte octet) {
Expand Down Expand Up @@ -485,7 +485,7 @@ public Base64(final boolean urlSafe) {
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @since 1.4
Expand All @@ -508,7 +508,7 @@ public Base64(final int lineLength) {
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand All @@ -535,7 +535,7 @@ public Base64(final int lineLength, final byte[] lineSeparator) {
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand Down Expand Up @@ -566,7 +566,7 @@ public Base64(final int lineLength, final byte[] lineSeparator, final boolean ur
* </p>
*
* @param lineLength
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
* decoding.
* @param lineSeparator
Expand Down Expand Up @@ -794,7 +794,7 @@ void encode(final byte[] in, int inPos, final int inAvail, final Context context
*
* @param octet
* The value to test
* @return {@code true} if the value is defined in the the Base64 alphabet {@code false} otherwise.
* @return {@code true} if the value is defined in the Base64 alphabet {@code false} otherwise.
*/
@Override
protected boolean isInAlphabet(final byte octet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public Base64InputStream(final InputStream in, final boolean doEncode) {
* true if we should encode all data read from us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
Expand All @@ -112,8 +112,8 @@ public Base64InputStream(final InputStream in, final boolean doEncode,
* true if we should encode all data read from us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public Base64OutputStream(final OutputStream out, final boolean doEncode) {
* true if we should encode all data written to us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
Expand All @@ -116,8 +116,8 @@ public Base64OutputStream(final OutputStream out, final boolean doEncode,
* true if we should encode all data written to us, false if we should decode.
* @param lineLength
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
* is false, lineLength is ignored.
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
* doEncode is false, lineLength is ignored.
* @param lineSeparator
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
Expand Down
Loading