mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
EnumUtil use Linked
This commit is contained in:
parent
5b2ea8aec7
commit
f05da040f0
@ -14,6 +14,7 @@
|
||||
* 【core 】 增加港澳台电话正则(pr#301@Gitee)
|
||||
* 【core 】 增加银行卡号脱敏(pr#301@Gitee)
|
||||
* 【cache 】 使用LongAddr代替AtomicLong(pr#301@Gitee)
|
||||
* 【cache 】 EnumUtil使用LinkedHashMap(pr#304@Gitee)
|
||||
|
||||
### Bug修复
|
||||
* 【core 】 修复Validator.isUrl()传空返回true(issue#I3ETTY@Gitee)
|
||||
|
@ -1,13 +1,14 @@
|
||||
package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
|
||||
/**
|
||||
* 枚举工具类
|
||||
*
|
||||
@ -239,7 +240,7 @@ public class EnumUtil {
|
||||
if (null == enums) {
|
||||
return null;
|
||||
}
|
||||
final Map<String, Object> map = new LinkedHashMap<>();
|
||||
final Map<String, Object> map = MapUtil.newHashMap(enums.length, true);
|
||||
for (Enum<?> e : enums) {
|
||||
map.put(e.name(), ReflectUtil.getFieldValue(e, fieldName));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user