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 bc3433493a Update Commons Codec. No functional change.
bc3433493a is described below

commit bc3433493a12e073e2ddf73758e3f27158d3afd6
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Nov 29 14:49:34 2022 +0000

    Update Commons Codec. No functional change.
---
 MERGE.txt                                                |  2 +-
 java/org/apache/tomcat/util/codec/binary/Base64.java     | 16 ++++++++--------
 java/org/apache/tomcat/util/codec/binary/BaseNCodec.java | 16 ++++++----------
 .../org/apache/tomcat/util/codec/binary/StringUtils.java |  5 +----
 webapps/docs/changelog.xml                               |  8 ++++++--
 5 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/MERGE.txt b/MERGE.txt
index 89c8ebc774..f0fa5d7dd5 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:
-fd44e6b491c9d606d0b91ac0029269d265024cd9 (2021-09-01)
+ae32a3f2fa6b722b8ad67bd125a52edb78932314 (2022-11-29)
 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 3cd4f1a558..d383e9b3cc 100644
--- a/java/org/apache/tomcat/util/codec/binary/Base64.java
+++ b/java/org/apache/tomcat/util/codec/binary/Base64.java
@@ -508,7 +508,7 @@ public class Base64 extends BaseNCodec {
      * </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
@@ -531,7 +531,7 @@ public class Base64 extends BaseNCodec {
      * </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
@@ -558,7 +558,7 @@ public class Base64 extends BaseNCodec {
      * </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
@@ -617,8 +617,8 @@ public class Base64 extends BaseNCodec {
      * https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
      * </p>
      *
-     * @param in
-     *            byte[] array of ascii data to base64 decode.
+     * @param input
+     *            byte[] array of ASCII data to base64 decode.
      * @param inPos
      *            Position to start reading data from.
      * @param inAvail
@@ -627,7 +627,7 @@ public class Base64 extends BaseNCodec {
      *            the context to be used
      */
     @Override
-    void decode(final byte[] in, int inPos, final int inAvail, final Context 
context) {
+    void decode(final byte[] input, int inPos, final int inAvail, final 
Context context) {
         if (context.eof) {
             return;
         }
@@ -636,7 +636,7 @@ public class Base64 extends BaseNCodec {
         }
         for (int i = 0; i < inAvail; i++) {
             final byte[] buffer = ensureBufferSize(decodeSize, context);
-            final byte b = in[inPos++];
+            final byte b = input[inPos++];
             if (b == pad) {
                 // We're done.
                 context.eof = true;
@@ -784,7 +784,7 @@ public class Base64 extends BaseNCodec {
      *
      * @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) {
diff --git a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java 
b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
index 177e3eacb7..3ff6864e54 100644
--- a/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
+++ b/java/org/apache/tomcat/util/codec/binary/BaseNCodec.java
@@ -45,7 +45,7 @@ public abstract class BaseNCodec implements BinaryEncoder, 
BinaryDecoder {
     static class Context {
 
         /**
-         * Place holder for the bytes we're dealing with for our based logic.
+         * Placeholder for the bytes we're dealing with for our based logic.
          * Bitwise operations store and extract the encoding or decoding from 
this variable.
          */
         int ibitWorkArea;
@@ -83,9 +83,6 @@ public abstract class BaseNCodec implements BinaryEncoder, 
BinaryDecoder {
          */
         int modulus;
 
-        Context() {
-        }
-
         /**
          * Returns a String useful for debugging (especially within a 
debugger.)
          *
@@ -205,9 +202,7 @@ public abstract class BaseNCodec implements BinaryEncoder, 
BinaryDecoder {
         // Integer.MAX_VALUE length array.
         // The result is that we may have to allocate an array of this size 
more than once if
         // the capacity must be expanded again.
-        return (minCapacity > MAX_BUFFER_SIZE) ?
-            minCapacity :
-            MAX_BUFFER_SIZE;
+        return Math.max(minCapacity, MAX_BUFFER_SIZE);
     }
 
     /**
@@ -264,7 +259,8 @@ public abstract class BaseNCodec implements BinaryEncoder, 
BinaryDecoder {
         return b;
     }
 
-    protected final byte pad; // instance variable just in case it needs to 
vary later
+    /** Pad byte. Instance variable just in case it needs to vary later. */
+    protected final byte pad;
 
     /** Number of bytes in each full block of unencoded data, e.g. 4 for 
Base64 and 5 for Base32 */
     private final int unencodedBlockSize;
@@ -275,7 +271,7 @@ public abstract class BaseNCodec implements BinaryEncoder, 
BinaryDecoder {
     /**
      * Chunksize for encoding. Not used when decoding.
      * A value of zero or less implies no chunking of the encoded data.
-     * Rounded down to nearest multiple of encodedBlockSize.
+     * Rounded down to the nearest multiple of encodedBlockSize.
      */
     protected final int lineLength;
 
@@ -532,7 +528,7 @@ public abstract class BaseNCodec implements BinaryEncoder, 
BinaryDecoder {
      *
      * @param pArray byte[] array which will later be encoded
      *
-     * @return amount of space needed to encoded the supplied array.
+     * @return amount of space needed to encode the supplied array.
      * Returns a long since a max-len array will require &gt; Integer.MAX_VALUE
      */
     public long getEncodedLength(final byte[] pArray) {
diff --git a/java/org/apache/tomcat/util/codec/binary/StringUtils.java 
b/java/org/apache/tomcat/util/codec/binary/StringUtils.java
index 979313bd8a..6a2b8131f6 100644
--- a/java/org/apache/tomcat/util/codec/binary/StringUtils.java
+++ b/java/org/apache/tomcat/util/codec/binary/StringUtils.java
@@ -41,10 +41,7 @@ public class StringUtils {
      * @return the encoded bytes
      */
     private static byte[] getBytes(final String string, final Charset charset) 
{
-        if (string == null) {
-            return null;
-        }
-        return string.getBytes(charset);
+        return string == null ? null : string.getBytes(charset);
     }
 
     /**
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fbf2b3757f..cc34efd544 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -144,10 +144,14 @@
         deprecated in Java 20 onwards, the reasons for deprecation are valid 
for
         all versions so move away from them now. (markt)
       </scode>
-      <add>
+      <update>
         Update the internal fork of Apache Commons BCEL to b015e90 (2022-11-28,
         6.7.0-RC1). (markt)
-      </add>
+      </update>
+      <update>
+        Update the internal fork of Apache Commons Codec to ae32a3f 
(2022-11-29,
+        1.16-SNAPSHOT). (markt)
+      </update>
       <update>
         Update to Commons Daemon 1.3.3. (markt)
       </update>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to