1. 修正语法检查
This commit is contained in:
parent
b09994e130
commit
772df51023
|
@ -11,7 +11,7 @@ import java.util.Locale;
|
||||||
* @author xajhuang @163.com
|
* @author xajhuang @163.com
|
||||||
*/
|
*/
|
||||||
public class MessageUtil {
|
public class MessageUtil {
|
||||||
private final static int arraySize = 2;
|
private static final int ARRAY_SIZE = 2;
|
||||||
|
|
||||||
private MessageUtil() {
|
private MessageUtil() {
|
||||||
throw new AssertionError("Instantiating utility class.");
|
throw new AssertionError("Instantiating utility class.");
|
||||||
|
@ -27,7 +27,7 @@ public class MessageUtil {
|
||||||
public static String get(String key, String language) {
|
public static String get(String key, String language) {
|
||||||
if (!StringUtils.isEmpty(language)) {
|
if (!StringUtils.isEmpty(language)) {
|
||||||
String[] arrs = language.split("_");
|
String[] arrs = language.split("_");
|
||||||
if (arrs.length == arraySize) {
|
if (arrs.length == ARRAY_SIZE) {
|
||||||
return get(key, new Locale(arrs[0], arrs[1]));
|
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) {
|
public static String get(String key, Object[] params, String language) {
|
||||||
if (!StringUtils.isEmpty(language)) {
|
if (!StringUtils.isEmpty(language)) {
|
||||||
String[] arrs = language.split("_");
|
String[] arrs = language.split("_");
|
||||||
if (arrs.length == arraySize) {
|
if (arrs.length == ARRAY_SIZE) {
|
||||||
return get(key, params, new Locale(arrs[0], arrs[1]));
|
return get(key, params, new Locale(arrs[0], arrs[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue