carterkozak commented on a change in pull request #335: Import of 
LogstashLayout as JsonTemplateLayout
URL: https://github.com/apache/logging-log4j2/pull/335#discussion_r405619866
 
 

 ##########
 File path: log4j-api/src/main/java/org/apache/logging/log4j/util/Strings.java
 ##########
 @@ -286,4 +295,23 @@ public static String join(final Iterator<?> iterator, 
final char separator) {
         return buf.toString();
     }
 
+    /**
+     * Creates a new string repeating given {@code str} {@code count} times.
+     * @param str input string
+     * @param count the repetition count
+     * @return the new string
+     * @throws IllegalArgumentException if either {@code str} is null or 
{@code count} is negative
+     */
+    public static String repeat(final String str, final int count) {
 
 Review comment:
   I think this is only used in test code, should we put it into a test util 
instead of log4j-api main api? Otherwise it could use some optimziation around 
edge cases, for example if count is zero we return empty string, one we return 
the input `str`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to