This is an automated email from the ASF dual-hosted git repository. markt-asf pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 16649f7231aff080d2b211275ebd1d6bdcca93b1 Author: Mark Thomas <[email protected]> AuthorDate: Mon Nov 30 15:16:11 2026 +0000 Update BCEL to 6.14.1 --- MERGE.txt | 2 +- .../tomcat/util/bcel/classfile/AnnotationElementValue.java | 2 +- .../apache/tomcat/util/bcel/classfile/ArrayElementValue.java | 2 +- .../tomcat/util/bcel/classfile/ClassFormatException.java | 11 +++++++++++ java/org/apache/tomcat/util/bcel/classfile/Constant.java | 2 +- java/org/apache/tomcat/util/bcel/classfile/ConstantPool.java | 10 +++++----- java/org/apache/tomcat/util/bcel/classfile/JavaClass.java | 2 +- webapps/docs/changelog.xml | 3 +++ 8 files changed, 24 insertions(+), 10 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 ced2a5dea4..88380c7068 100644 --- a/java/org/apache/tomcat/util/bcel/classfile/Constant.java +++ b/java/org/apache/tomcat/util/bcel/classfile/Constant.java @@ -69,7 +69,7 @@ public abstract class Constant { skipSize = 4; // unsigned short, unsigned short break; default: - throw new ClassFormatException("Invalid byte tag in constant pool: " + b); + 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 4cee4afd5f..ae94777bb1 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -752,6 +752,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]
