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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new bbf404c3ce Update BCEL to 6.14.1
bbf404c3ce is described below

commit bbf404c3ce561679dc549fc6582d84c9b7b1c90a
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Nov 30 15:16:11 2026 +0000

    Update BCEL to 6.14.1
---
 MERGE.txt                                          |  2 +-
 .../bcel/classfile/AnnotationElementValue.java     |  2 +-
 .../util/bcel/classfile/ArrayElementValue.java     |  2 +-
 .../util/bcel/classfile/ClassFormatException.java  | 11 ++++
 .../tomcat/util/bcel/classfile/Constant.java       | 62 +++++++++++-----------
 .../tomcat/util/bcel/classfile/ConstantPool.java   | 10 ++--
 .../tomcat/util/bcel/classfile/JavaClass.java      |  2 +-
 webapps/docs/changelog.xml                         |  3 ++
 8 files changed, 54 insertions(+), 40 deletions(-)

diff --git a/MERGE.txt b/MERGE.txt
index ae5fde42fe..13b920feec 100644
--- a/MERGE.txt
+++ b/MERGE.txt
@@ -37,7 +37,7 @@ Unused code is removed
 Sub-tree:
 src/main/java/org/apache/bcel
 The SHA1 ID / tag for the most recent commit to be merged to Tomcat is:
-rel/commons-bcel-6.12.0 (2026-01-22)
+rel/commons-bcel-6.14.1 (2026-11-30)
 
 FileUpload
 ----------
diff --git 
a/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java 
b/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
index a1f85c9a36..8a105b0416 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/AnnotationElementValue.java
@@ -26,7 +26,7 @@ public class AnnotationElementValue extends ElementValue {
     AnnotationElementValue(final int type, final AnnotationEntry 
annotationEntry, final ConstantPool cpool) {
         super(type, cpool);
         if (type != ANNOTATION) {
-            throw new ClassFormatException("Only element values of type 
annotation can be built with this ctor - type specified: " + type);
+            throw new ClassFormatException("Only element values of type 
annotation can be built with this ctor - type specified: %s", 
Integer.valueOf(type));
         }
         this.annotationEntry = annotationEntry;
     }
diff --git a/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java 
b/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
index 0e46cbb2d3..9d1c61c52b 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/ArrayElementValue.java
@@ -27,7 +27,7 @@ public class ArrayElementValue extends ElementValue
     ArrayElementValue(final int type, final ElementValue[] elementValues, 
final ConstantPool cpool) {
         super(type, cpool);
         if (type != ARRAY) {
-            throw new ClassFormatException("Only element values of type array 
can be built with this ctor - type specified: " + type);
+            throw new ClassFormatException("Only element values of type 
annotation can be built with this ctor - type specified: %s", 
Integer.valueOf(type));
         }
         this.elementValues = elementValues != null ? elementValues : 
EMPTY_ARRAY;
     }
diff --git 
a/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java 
b/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java
index d0328da501..39c15d75d0 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/ClassFormatException.java
@@ -40,6 +40,17 @@ public class ClassFormatException extends RuntimeException {
         super(message);
     }
 
+    /**
+     * Constructs a new instance with the specified detail message formatted 
with See {@link String#format(String, Object...)}.
+     *
+     * @param format See {@link String#format(String, Object...)}.
+     * @param args   See {@link String#format(String, Object...)}.
+     * @since 6.14.0
+     */
+    public ClassFormatException(String format, Object... args) {
+        super(String.format(format, args));
+    }
+
     /**
      * Constructs a new instance with the specified detail message and cause.
      *
diff --git a/java/org/apache/tomcat/util/bcel/classfile/Constant.java 
b/java/org/apache/tomcat/util/bcel/classfile/Constant.java
index 8b266b2b2d..88380c7068 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/Constant.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/Constant.java
@@ -39,37 +39,37 @@ public abstract class Constant {
         final byte b = dataInput.readByte(); // Read tag byte
         int skipSize;
         switch (b) {
-        case Const.CONSTANT_Class:
-            return new ConstantClass(dataInput);
-        case Const.CONSTANT_Integer:
-            return new ConstantInteger(dataInput);
-        case Const.CONSTANT_Float:
-            return new ConstantFloat(dataInput);
-        case Const.CONSTANT_Long:
-            return new ConstantLong(dataInput);
-        case Const.CONSTANT_Double:
-            return new ConstantDouble(dataInput);
-        case Const.CONSTANT_Utf8:
-            return ConstantUtf8.getInstance(dataInput);
-        case Const.CONSTANT_String:
-        case Const.CONSTANT_MethodType:
-        case Const.CONSTANT_Module:
-        case Const.CONSTANT_Package:
-            skipSize = 2; // unsigned short
-            break;
-        case Const.CONSTANT_MethodHandle:
-            skipSize = 3; // unsigned byte, unsigned short
-            break;
-        case Const.CONSTANT_Fieldref:
-        case Const.CONSTANT_Methodref:
-        case Const.CONSTANT_InterfaceMethodref:
-        case Const.CONSTANT_NameAndType:
-        case Const.CONSTANT_Dynamic:
-        case Const.CONSTANT_InvokeDynamic:
-            skipSize = 4; // unsigned short, unsigned short
-            break;
-        default:
-            throw new ClassFormatException("Invalid byte tag in constant pool: 
" + b);
+            case Const.CONSTANT_Class:
+                return new ConstantClass(dataInput);
+            case Const.CONSTANT_Integer:
+                return new ConstantInteger(dataInput);
+            case Const.CONSTANT_Float:
+                return new ConstantFloat(dataInput);
+            case Const.CONSTANT_Long:
+                return new ConstantLong(dataInput);
+            case Const.CONSTANT_Double:
+                return new ConstantDouble(dataInput);
+            case Const.CONSTANT_Utf8:
+                return ConstantUtf8.getInstance(dataInput);
+            case Const.CONSTANT_String:
+            case Const.CONSTANT_MethodType:
+            case Const.CONSTANT_Module:
+            case Const.CONSTANT_Package:
+                skipSize = 2; // unsigned short
+                break;
+            case Const.CONSTANT_MethodHandle:
+                skipSize = 3; // unsigned byte, unsigned short
+                break;
+            case Const.CONSTANT_Fieldref:
+            case Const.CONSTANT_Methodref:
+            case Const.CONSTANT_InterfaceMethodref:
+            case Const.CONSTANT_NameAndType:
+            case Const.CONSTANT_Dynamic:
+            case Const.CONSTANT_InvokeDynamic:
+                skipSize = 4; // unsigned short, unsigned short
+                break;
+            default:
+                throw new ClassFormatException("Invalid byte tag in constant 
pool: %s", Byte.valueOf(b));
         }
         Utility.skipFully(dataInput, skipSize);
         return null;
diff --git a/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java 
b/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
index 083c0465f2..eb670579ea 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java
@@ -90,7 +90,7 @@ public class ConstantPool {
     public <T extends Constant> T getConstant(final int index, final byte tag) 
throws ClassFormatException {
         final T c = getConstant(index);
         if (c.getTag() != tag) {
-            throw new ClassFormatException("Expected class '" + 
Const.getConstantName(tag) + "' at index " + index + " and got " + c);
+            throw new ClassFormatException("Expected class '%s' at index %,d 
and got %s", Const.getConstantName(tag), Integer.valueOf(index), c);
         }
         return c;
     }
@@ -107,7 +107,7 @@ public class ConstantPool {
      */
     public <T extends Constant> T getConstant(final int index, final Class<T> 
castTo) throws ClassFormatException {
         if (index >= constantPool.length || index < 1) {
-            throw new ClassFormatException("Invalid constant pool reference 
using index: " + index + ". Constant pool size is: " + constantPool.length);
+            throw new ClassFormatException("Invalid constant pool reference 
using index: %,d. Constant pool size is: %,d", Integer.valueOf(index), 
Integer.valueOf(constantPool.length));
         }
         if (constantPool[index] != null && 
!castTo.isAssignableFrom(constantPool[index].getClass())) {
             throw new ClassFormatException("Invalid constant pool reference at 
index: " + index +
@@ -116,14 +116,14 @@ public class ConstantPool {
         if (index > 1) {
             final Constant prev = constantPool[index - 1];
             if (prev != null && (prev.getTag() == Const.CONSTANT_Double || 
prev.getTag() == Const.CONSTANT_Long)) {
-                throw new ClassFormatException("Constant pool at index " + 
index + " is invalid. The index is unused due to the preceeding "
-                        + Const.getConstantName(prev.getTag()) + ".");
+                throw new ClassFormatException("Constant pool at index %,d is 
invalid. The index is unused due to the preceding %s.", Integer.valueOf(index),
+                        Const.getConstantName(prev.getTag()));
             }
         }
         // Previous check ensures this won't throw a ClassCastException
         final T c = castTo.cast(constantPool[index]);
         if (c == null) {
-            throw new ClassFormatException("Constant pool at index " + index + 
" is null.");
+            throw new ClassFormatException("Constant pool at index %,d is 
null.", Integer.valueOf(index));
         }
         return c;
     }
diff --git a/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java 
b/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
index dc5c140eab..6220d17a18 100644
--- a/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
+++ b/java/org/apache/tomcat/util/bcel/classfile/JavaClass.java
@@ -126,7 +126,7 @@ public class JavaClass {
 
 
     /**
-     * returns the super class name of this class. In the case that this class 
is {@link Object}, it will return itself
+     * Gets the superclass name of this class. In the case that this class is 
{@link Object}, it will return itself
      * ({@link Object}). This is probably incorrect but isn't fixed at this 
time to not break existing clients.
      *
      * @return Superclass name.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9920645a7e..b1894c9c27 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -535,6 +535,9 @@
       <update>
         Update Bouncy Castle to 1.87. (markt)
       </update>
+      <update>
+        Update package renamed fork of Commons BCEL to 6.14.1. (markt)
+      </update>
     </changelog>
   </subsection>
 </section>


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

Reply via email to