This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 67e83a7 Update Codec - no substantive changes 67e83a7 is described below commit 67e83a7d690b78f6f0cb9fd5cacd579cbe503d89 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jan 15 12:27:10 2021 +0000 Update Codec - no substantive changes --- MERGE.txt | 2 +- java/org/apache/tomcat/util/codec/binary/Base64.java | 10 +++++----- java/org/apache/tomcat/util/codec/binary/StringUtils.java | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MERGE.txt b/MERGE.txt index 58541c1..1c449c7 100644 --- a/MERGE.txt +++ b/MERGE.txt @@ -43,7 +43,7 @@ Codec Sub-tree: src/main/java/org/apache/commons/codec The SHA1 ID / tag for the most recent commit to be merged to Tomcat is: -53c93d0ffccb65d182306c74d1230ce814889dc1 (2020-08-18) +2e9785b93a2aacedd84abc6a646cdb200940b818 (2021-01-15) Note: Only classes required for Base64 encoding/decoding. The rest are removed. FileUpload diff --git a/java/org/apache/tomcat/util/codec/binary/Base64.java b/java/org/apache/tomcat/util/codec/binary/Base64.java index 2b5c7d4..08d7d34 100644 --- a/java/org/apache/tomcat/util/codec/binary/Base64.java +++ b/java/org/apache/tomcat/util/codec/binary/Base64.java @@ -360,8 +360,8 @@ public class Base64 extends BaseNCodec { * @since 1.5 */ public static boolean isBase64(final byte[] arrayOctet) { - for (byte b : arrayOctet) { - if (!isBase64(b) && !isWhiteSpace(b)) { + for (byte element : arrayOctet) { + if (!isBase64(element) && !isWhiteSpace(element)) { return false; } } @@ -428,7 +428,8 @@ public class Base64 extends BaseNCodec { private static void validateCharacter(final int emptyBitsMask, final Context context) { if ((context.ibitWorkArea & emptyBitsMask) != 0) { throw new IllegalArgumentException( - "Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value. " + + "Last encoded character (before the paddings if any) is a valid " + + "base 64 alphabet but not a possible value. " + "Expected the discarded bits to be zero."); } } @@ -586,8 +587,7 @@ public class Base64 extends BaseNCodec { } if (lineLength > 0){ // null line-sep forces no chunking rather than throwing IAE this.encodeSize = BYTES_PER_ENCODED_BLOCK + lineSeparator.length; - this.lineSeparator = new byte[lineSeparator.length]; - System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length); + this.lineSeparator = lineSeparator.clone(); } else { this.encodeSize = BYTES_PER_ENCODED_BLOCK; this.lineSeparator = null; diff --git a/java/org/apache/tomcat/util/codec/binary/StringUtils.java b/java/org/apache/tomcat/util/codec/binary/StringUtils.java index 673dd0f..979313b 100644 --- a/java/org/apache/tomcat/util/codec/binary/StringUtils.java +++ b/java/org/apache/tomcat/util/codec/binary/StringUtils.java @@ -55,8 +55,8 @@ public class StringUtils { * the String to encode, may be {@code null} * @return encoded bytes, or {@code null} if the input string was {@code null} * @throws NullPointerException - * Thrown if {@link StandardCharsets#UTF_8} is not initialized, which should never happen since it is - * required by the Java platform specification. + * Thrown if {@link StandardCharsets#UTF_8} is not initialized, which should never happen + * since it is required by the Java platform specification. * @since As of 1.7, throws {@link NullPointerException} instead of UnsupportedEncodingException * @see <a href="http://download.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard charsets</a> */ @@ -88,8 +88,8 @@ public class StringUtils { * @return A new {@code String} decoded from the specified array of bytes using the US-ASCII charset, * or {@code null} if the input byte array was {@code null}. * @throws NullPointerException - * Thrown if {@link StandardCharsets#US_ASCII} is not initialized, which should never happen since it is - * required by the Java platform specification. + * Thrown if {@link StandardCharsets#US_ASCII} is not initialized, which should never happen + * since it is required by the Java platform specification. * @since As of 1.7, throws {@link NullPointerException} instead of UnsupportedEncodingException */ public static String newStringUsAscii(final byte[] bytes) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org