Commit 6134c0d0 authored by mooomooo's avatar mooomooo

Use jdk8 safe version of string repeat

parent 766dd64f
......@@ -50,9 +50,9 @@ public class Util {
public static String redact(String in) {
if(in.length() < 2) {
return "*".repeat(in.length());
return new String(new char[in.length()]).replace("\0", "*");
}
int unredactAfter = in.length()-2;
return "*".repeat(unredactAfter) + in.substring(unredactAfter);
return new String(new char[unredactAfter]).replace("\0", "*") + in.substring(unredactAfter);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment