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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git


The following commit(s) were added to refs/heads/master by this push:
     new b23da0ef Exception message in Args.requireU2() refers to the wrong 
upper range value
b23da0ef is described below

commit b23da0ef659f5a2ed2bb78c33eaf0288b59fcff3
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jan 12 08:36:38 2026 -0500

    Exception message in Args.requireU2() refers to the wrong upper range
    value
---
 src/changes/changes.xml                      | 1 +
 src/main/java/org/apache/bcel/util/Args.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8128a5dd..319ea3bb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -66,6 +66,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">Fix malformed Javadoc comments.</action>
       <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">Make the build reproducible on the Azul JDK.</action>
       <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">Exception message in Args.requireU4() refers to the wrong data 
type.</action>
+      <action                  type="fix" dev="ggregory" due-to="Gary 
Gregory">Exception message in Args.requireU2() refers to the wrong upper range 
value.</action>
       <!-- ADD -->
       <action                  type="add" dev="ggregory" due-to="Gary 
Gregory">Add Const.MAJOR_26.</action>
       <action                  type="add" dev="ggregory" due-to="Gary 
Gregory">Add Const.MINOR_26.</action>
diff --git a/src/main/java/org/apache/bcel/util/Args.java 
b/src/main/java/org/apache/bcel/util/Args.java
index ba46952f..37c9756d 100644
--- a/src/main/java/org/apache/bcel/util/Args.java
+++ b/src/main/java/org/apache/bcel/util/Args.java
@@ -86,7 +86,7 @@ public class Args {
             throw new IllegalArgumentException(String.format("%s programming 
error: min %,d < 0", message, min));
         }
         if (value < min || value > max) {
-            throw new ClassFormatException(String.format("%s [Value out of 
range (%,d - %,d) for type u2: %,d]", message, min, Const.MAX_SHORT, value));
+            throw new ClassFormatException(String.format("%s [Value out of 
range (%,d - %,d) for type u2: %,d]", message, min, max, value));
         }
         return value;
     }

Reply via email to