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 de2f7690 Better use Math.max (#151)
de2f7690 is described below

commit de2f76903e1d91473ed8ef3fc6e7409f44d5805c
Author: Arturo Bernal <[email protected]>
AuthorDate: Sun Oct 2 19:14:33 2022 +0200

    Better use Math.max (#151)
---
 src/main/java/org/apache/bcel/classfile/Utility.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/bcel/classfile/Utility.java 
b/src/main/java/org/apache/bcel/classfile/Utility.java
index 96a478f9..da5d857d 100644
--- a/src/main/java/org/apache/bcel/classfile/Utility.java
+++ b/src/main/java/org/apache/bcel/classfile/Utility.java
@@ -728,7 +728,7 @@ public abstract class Utility {
      */
     public static String fillup(final String str, final int length, final 
boolean left_justify, final char fill) {
         final int len = length - str.length();
-        final char[] buf = new char[len < 0 ? 0 : len];
+        final char[] buf = new char[Math.max(len, 0)];
         Arrays.fill(buf, fill);
         if (left_justify) {
             return str + new String(buf);

Reply via email to