来自intellij
format(String format, Object... args)
public static String format(String var0, Object... var1) {
return (new Formatter()).format(var0, var1).toString();
}
public Formatter format(Locale var1, String var2, Object... var3) {
this.ensureOpen();
int var4 = -1;
int var5 = -1;
Formatter.FormatString[] var6 = this.parse(var2);
for(int var7 = 0; var7 < var6.length; ++var7) {
Formatter.FormatString var8 = var6[var7];
int var9 = var8.index();
try {
switch(var9) {
case -2:
var8.print((Object)null, var1);
break;
case -1:
if(var4 < 0 || var3 != null && var4 > var3.length - 1) {
throw new MissingFormatArgumentException(var8.toString());
}
var8.print(var3 == null?null:var3[var4], var1);
break;
case 0:
++var5;
var4 = var5;
if(var3 != null && var5 > var3.length - 1) {
throw new MissingFormatArgumentException(var8.toString());
}
var8.print(var3 == null?null:var3[var5], var1);
break;
default:
var4 = var9 - 1;
if(var3 != null && var4 > var3.length - 1) {
throw new MissingFormatArgumentException(var8.toString());
}
var8.print(var3 == null?null:var3[var4], var1);
}
} catch (IOException var11) {
this.lastException = var11;
}
}
return this;
}