Skip to content
代码片段 群组 项目
未验证 提交 23c92ce7 编辑于 作者: SC's avatar SC 提交者: GitHub
浏览文件

MINOR: Use String#format for niceMemoryUnits result (#12389)

Reviewers: Luke Chen <showuon@gmail.com>, Divij Vaidya <diviv@amazon.com>
上级 0bc8da7a
No related branches found
No related tags found
无相关合并请求
......@@ -1243,15 +1243,16 @@ public class ConfigDef {
break;
}
}
String resultFormat = " (" + value + " %s" + (value == 1 ? ")" : "s)");
switch (i) {
case 1:
return " (" + value + " kibibyte" + (value == 1 ? ")" : "s)");
return String.format(resultFormat, "kibibyte");
case 2:
return " (" + value + " mebibyte" + (value == 1 ? ")" : "s)");
return String.format(resultFormat, "mebibyte");
case 3:
return " (" + value + " gibibyte" + (value == 1 ? ")" : "s)");
return String.format(resultFormat, "gibibyte");
case 4:
return " (" + value + " tebibyte" + (value == 1 ? ")" : "s)");
return String.format(resultFormat, "tebibyte");
default:
return "";
}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册