1. 修正语法检查

This commit is contained in:
黄昕 2024-04-09 14:55:55 +08:00
parent b09994e130
commit 772df51023
1 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import java.util.Locale;
* @author xajhuang @163.com
*/
public class MessageUtil {
private final static int arraySize = 2;
private static final int ARRAY_SIZE = 2;
private MessageUtil() {
throw new AssertionError("Instantiating utility class.");
@ -27,7 +27,7 @@ public class MessageUtil {
public static String get(String key, String language) {
if (!StringUtils.isEmpty(language)) {
String[] arrs = language.split("_");
if (arrs.length == arraySize) {
if (arrs.length == ARRAY_SIZE) {
return get(key, new Locale(arrs[0], arrs[1]));
}
}
@ -46,7 +46,7 @@ public class MessageUtil {
public static String get(String key, Object[] params, String language) {
if (!StringUtils.isEmpty(language)) {
String[] arrs = language.split("_");
if (arrs.length == arraySize) {
if (arrs.length == ARRAY_SIZE) {
return get(key, params, new Locale(arrs[0], arrs[1]));
}
}