Skip to content

Commit 889abcf

Browse files
committed
Merge branch 'pr-139'
This closes #139
2 parents 11f9498 + da692ed commit 889abcf

51 files changed

Lines changed: 152 additions & 157 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

RELEASE-NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ o Bump checkstyle from 8.45.1 to 9.2.1 #97, #100, #101. Thanks to De
3636

3737

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

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

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ limitations under the License.
392392
<groupId>org.apache.maven.plugins</groupId>
393393
<artifactId>maven-checkstyle-plugin</artifactId>
394394
</plugin>
395-
<!-- Specify source for JDK 11+ javadoc tool to ignore the 'unamed' module.
395+
<!-- Specify source for JDK 11+ javadoc tool to ignore the 'unnamed' module.
396396
See: https://bugs.openjdk.java.net/browse/JDK-8212233.
397397
To be removed with parent 49. -->
398398
<plugin>

src/changes/changes.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The <action> type attribute can be add,update,fix,remove.
5252
<action dev="ggregory" type="fix" due-to="Arturo Bernal">Use String.contains() functions #125.</action>
5353
<action dev="ggregory" type="fix" due-to="Arturo Bernal">Avoid use toString() or substring() in favor of a simplified expression #126.</action>
5454
<action issue="CODEC-305" dev="aherbert" type="fix" due-to="Florian">Fix byte-skipping in Base16 decoding #135.</action>
55+
<action dev="kinow" type="fix" due-to="Marc Wrobel">Fix several typos, improve writing in some javadocs #139.</action>
5556
<!-- ADD -->
5657
<action issue="CODEC-296" dev="mattsicker" type="add" due-to="Matt Sicker">Add support for Blake3 family of hashes.</action>
5758
<action dev="ggregory" type="add">Add github/codeql-action.</action>
@@ -333,7 +334,7 @@ The <action> type attribute can be add,update,fix,remove.
333334
</release>
334335
<release version="1.4" date="9 August 2009" description="Feature and fix release. Requires a minimum of Java 1.4.">
335336
<action dev="ggregory" type="fix" issue="CODEC-80" due-to="Julius Davies">
336-
Regression: Base64.encode(chunk=true) has bug when input length is multiple of 76.
337+
Regression: Base64.encode(chunk=true) has a bug when input length is multiple of 76.
337338
</action>
338339
<action dev="ggregory" type="fix" issue="CODEC-77" due-to="Julius Davies">
339340
Base64 bug with empty input (new byte[0]).
@@ -411,7 +412,7 @@ The <action> type attribute can be add,update,fix,remove.
411412
Double Metaphone bugs in alternative encoding.
412413
</action>
413414
<action dev="ggregory" type="fix" issue="CODEC-73" due-to="Benjamin Bentmann">
414-
Make string2byte conversions indepedent of platform default encoding.
415+
Make string2byte conversions independent of platform default encoding.
415416
</action>
416417
</release>
417418
<release version="1.3" date="10 July 2004" description="Feature and fix release.">
@@ -439,7 +440,7 @@ The <action> type attribute can be add,update,fix,remove.
439440
RefinedSoundex: Implemented the DIFFERENCE algorithm.
440441
</action>
441442
<action dev="ggregory" type="update">
442-
This version is relesed under the
443+
This version is released under the
443444
&lt;a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0&lt;/a>
444445
, please see LICENSE.txt. Previous versions were released under the
445446
&lt;a href="http://www.apache.org/licenses/LICENSE-1.1">Apache License 1.1&lt;/a>

src/main/java/org/apache/commons/codec/EncoderException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/**
2121
* Thrown when there is a failure condition during the encoding process. This exception is thrown when an
22-
* {@link Encoder} encounters a encoding specific exception such as invalid data, inability to calculate a checksum,
22+
* {@link Encoder} encounters an encoding specific exception such as invalid data, inability to calculate a checksum,
2323
* characters outside of the expected range.
2424
*
2525
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void encode(final byte[] data, final int offset, final int length, final Context
245245
*
246246
* @param octet The value to test.
247247
*
248-
* @return {@code true} if the value is defined in the the Base16 alphabet {@code false} otherwise.
248+
* @return {@code true} if the value is defined in the Base16 alphabet {@code false} otherwise.
249249
*/
250250
@Override
251251
public boolean isInAlphabet(final byte octet) {

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,6 @@ public class Base32 extends BaseNCodec {
124124
// The private member fields below are used with the new streaming approach, which requires
125125
// some state be preserved between calls of encode() and decode().
126126

127-
/**
128-
* Place holder for the bytes we're dealing with for our based logic.
129-
* Bitwise operations store and extract the encoding or decoding from this variable.
130-
*/
131-
132127
/**
133128
* Convenience variable to help us determine when our buffer is going to run out of room and needs resizing.
134129
* {@code decodeSize = {@link #BYTES_PER_ENCODED_BLOCK} - 1 + lineSeparator.length;}
@@ -161,7 +156,6 @@ public class Base32 extends BaseNCodec {
161156
* <p>
162157
* When encoding the line length is 0 (no chunking).
163158
* </p>
164-
*
165159
*/
166160
public Base32() {
167161
this(false);
@@ -208,7 +202,7 @@ public Base32(final byte pad) {
208202
* </p>
209203
*
210204
* @param lineLength
211-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
205+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
212206
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
213207
* decoding.
214208
*/
@@ -226,7 +220,7 @@ public Base32(final int lineLength) {
226220
* </p>
227221
*
228222
* @param lineLength
229-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
223+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
230224
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
231225
* decoding.
232226
* @param lineSeparator
@@ -248,7 +242,7 @@ public Base32(final int lineLength, final byte[] lineSeparator) {
248242
* </p>
249243
*
250244
* @param lineLength
251-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
245+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
252246
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
253247
* decoding.
254248
* @param lineSeparator
@@ -273,7 +267,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
273267
* </p>
274268
*
275269
* @param lineLength
276-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
270+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
277271
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
278272
* decoding.
279273
* @param lineSeparator
@@ -299,7 +293,7 @@ public Base32(final int lineLength, final byte[] lineSeparator, final boolean us
299293
* </p>
300294
*
301295
* @param lineLength
302-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
296+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
303297
* 8). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
304298
* decoding.
305299
* @param lineSeparator
@@ -580,7 +574,7 @@ void encode(final byte[] input, int inPos, final int inAvail, final Context cont
580574
*
581575
* @param octet
582576
* The value to test
583-
* @return {@code true} if the value is defined in the the Base32 alphabet {@code false} otherwise.
577+
* @return {@code true} if the value is defined in the Base32 alphabet {@code false} otherwise.
584578
*/
585579
@Override
586580
public boolean isInAlphabet(final byte octet) {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public Base32InputStream(final InputStream in, final boolean doEncode) {
8787
* true if we should encode all data read from us, false if we should decode.
8888
* @param lineLength
8989
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
90-
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
91-
* is false, lineLength is ignored.
90+
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
91+
* doEncode is false, lineLength is ignored.
9292
* @param lineSeparator
9393
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
9494
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
@@ -108,8 +108,8 @@ public Base32InputStream(final InputStream input, final boolean doEncode,
108108
* true if we should encode all data read from us, false if we should decode.
109109
* @param lineLength
110110
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
111-
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
112-
* is false, lineLength is ignored.
111+
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
112+
* doEncode is false, lineLength is ignored.
113113
* @param lineSeparator
114114
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
115115
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,44 +85,44 @@ public Base32OutputStream(final OutputStream out, final boolean doEncode) {
8585
* Creates a Base32OutputStream such that all data written is either Base32-encoded or Base32-decoded to the
8686
* original provided OutputStream.
8787
*
88-
* @param ouput
88+
* @param output
8989
* OutputStream to wrap.
9090
* @param doEncode
9191
* true if we should encode all data written to us, false if we should decode.
9292
* @param lineLength
9393
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
94-
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
95-
* is false, lineLength is ignored.
94+
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
95+
* doEncode is false, lineLength is ignored.
9696
* @param lineSeparator
9797
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
9898
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
9999
*/
100-
public Base32OutputStream(final OutputStream ouput, final boolean doEncode,
100+
public Base32OutputStream(final OutputStream output, final boolean doEncode,
101101
final int lineLength, final byte[] lineSeparator) {
102-
super(ouput, new Base32(lineLength, lineSeparator), doEncode);
102+
super(output, new Base32(lineLength, lineSeparator), doEncode);
103103
}
104104

105105
/**
106106
* Creates a Base32OutputStream such that all data written is either Base32-encoded or Base32-decoded to the
107107
* original provided OutputStream.
108108
*
109-
* @param ouput
109+
* @param output
110110
* OutputStream to wrap.
111111
* @param doEncode
112112
* true if we should encode all data written to us, false if we should decode.
113113
* @param lineLength
114114
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
115-
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
116-
* is false, lineLength is ignored.
115+
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
116+
* doEncode is false, lineLength is ignored.
117117
* @param lineSeparator
118118
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
119119
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
120120
* @param decodingPolicy The decoding policy.
121121
* @since 1.15
122122
*/
123-
public Base32OutputStream(final OutputStream ouput, final boolean doEncode,
123+
public Base32OutputStream(final OutputStream output, final boolean doEncode,
124124
final int lineLength, final byte[] lineSeparator, final CodecPolicy decodingPolicy) {
125-
super(ouput, new Base32(lineLength, lineSeparator, false, BaseNCodec.PAD_DEFAULT, decodingPolicy), doEncode);
125+
super(output, new Base32(lineLength, lineSeparator, false, BaseNCodec.PAD_DEFAULT, decodingPolicy), doEncode);
126126
}
127127

128128
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public static boolean isArrayByteBase64(final byte[] arrayOctet) {
340340
*
341341
* @param octet
342342
* The value to test
343-
* @return {@code true} if the value is defined in the the base 64 alphabet, {@code false} otherwise.
343+
* @return {@code true} if the value is defined in the base 64 alphabet, {@code false} otherwise.
344344
* @since 1.4
345345
*/
346346
public static boolean isBase64(final byte octet) {
@@ -485,7 +485,7 @@ public Base64(final boolean urlSafe) {
485485
* </p>
486486
*
487487
* @param lineLength
488-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
488+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
489489
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
490490
* decoding.
491491
* @since 1.4
@@ -508,7 +508,7 @@ public Base64(final int lineLength) {
508508
* </p>
509509
*
510510
* @param lineLength
511-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
511+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
512512
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
513513
* decoding.
514514
* @param lineSeparator
@@ -535,7 +535,7 @@ public Base64(final int lineLength, final byte[] lineSeparator) {
535535
* </p>
536536
*
537537
* @param lineLength
538-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
538+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
539539
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
540540
* decoding.
541541
* @param lineSeparator
@@ -566,7 +566,7 @@ public Base64(final int lineLength, final byte[] lineSeparator, final boolean ur
566566
* </p>
567567
*
568568
* @param lineLength
569-
* Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
569+
* Each line of encoded data will be at most of the given length (rounded down to the nearest multiple of
570570
* 4). If lineLength &lt;= 0, then the output will not be divided into lines (chunks). Ignored when
571571
* decoding.
572572
* @param lineSeparator
@@ -794,7 +794,7 @@ void encode(final byte[] in, int inPos, final int inAvail, final Context context
794794
*
795795
* @param octet
796796
* The value to test
797-
* @return {@code true} if the value is defined in the the Base64 alphabet {@code false} otherwise.
797+
* @return {@code true} if the value is defined in the Base64 alphabet {@code false} otherwise.
798798
*/
799799
@Override
800800
protected boolean isInAlphabet(final byte octet) {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public Base64InputStream(final InputStream in, final boolean doEncode) {
9191
* true if we should encode all data read from us, false if we should decode.
9292
* @param lineLength
9393
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
94-
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
95-
* is false, lineLength is ignored.
94+
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
95+
* doEncode is false, lineLength is ignored.
9696
* @param lineSeparator
9797
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
9898
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.
@@ -112,8 +112,8 @@ public Base64InputStream(final InputStream in, final boolean doEncode,
112112
* true if we should encode all data read from us, false if we should decode.
113113
* @param lineLength
114114
* If doEncode is true, each line of encoded data will contain lineLength characters (rounded down to
115-
* nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If doEncode
116-
* is false, lineLength is ignored.
115+
* the nearest multiple of 4). If lineLength &lt;= 0, the encoded data is not divided into lines. If
116+
* doEncode is false, lineLength is ignored.
117117
* @param lineSeparator
118118
* If doEncode is true, each line of encoded data will be terminated with this byte sequence (e.g. \r\n).
119119
* If lineLength &lt;= 0, the lineSeparator is not used. If doEncode is false lineSeparator is ignored.

0 commit comments

Comments
 (0)