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 32f22dc Use Arrays.fill().
32f22dc is described below
commit 32f22dcc5aab94c0805931aab67365357335f222
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Nov 20 16:58:27 2020 -0500
Use Arrays.fill().
---
src/main/java/org/apache/bcel/classfile/Utility.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/bcel/classfile/Utility.java
b/src/main/java/org/apache/bcel/classfile/Utility.java
index c1bbb2d..094e3db 100644
--- a/src/main/java/org/apache/bcel/classfile/Utility.java
+++ b/src/main/java/org/apache/bcel/classfile/Utility.java
@@ -29,6 +29,7 @@ import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.zip.GZIPInputStream;
@@ -1352,9 +1353,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];
- for (int j = 0; j < buf.length; j++) {
- buf[j] = fill;
- }
+ Arrays.fill(buf, fill);
if (left_justify) {
return str + new String(buf);
}