You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/01/15 12:28:03 UTC

[tomcat] branch 9.0.x updated: Update Codec - no substantive changes

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new ee582a4  Update Codec - no substantive changes
ee582a4 is described below

commit ee582a4ef0baa29d88e154b5d3d8efaa1ca418f6
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org