mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add default value for ArrayUtil.unwrap
This commit is contained in:
parent
25e57bd4e9
commit
69362f1031
@ -9,6 +9,7 @@
|
||||
* 【core 】 ConsoleTable代码优化(pr#190@Gitee)
|
||||
* 【http 】 HttpRequest增加setProxy重载(pr#190@Gitee)
|
||||
* 【core 】 XmlUtil.cleanComment(pr#191@Gitee)
|
||||
* 【core 】 ArrayUtil.unWrap增加默认值(pr#1149@Github)
|
||||
|
||||
### Bug修复
|
||||
* 【core 】 解决农历判断节日未判断大小月导致的问题(issue#I1XHSF@Gitee)
|
||||
|
@ -1777,7 +1777,7 @@ public class ArrayUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 包装类数组转为原始类型数组
|
||||
* 包装类数组转为原始类型数组,null转为0
|
||||
*
|
||||
* @param values 包装类型数组
|
||||
* @return 原始类型数组
|
||||
@ -1793,7 +1793,7 @@ public class ArrayUtil {
|
||||
|
||||
final int[] array = new int[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
array[i] = values[i];
|
||||
array[i] = ObjectUtil.defaultIfNull(values[i], 0);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
@ -1837,7 +1837,7 @@ public class ArrayUtil {
|
||||
|
||||
final long[] array = new long[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
array[i] = values[i];
|
||||
array[i] = ObjectUtil.defaultIfNull(values[i], 0L);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
@ -1881,7 +1881,7 @@ public class ArrayUtil {
|
||||
|
||||
char[] array = new char[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
array[i] = values[i];
|
||||
array[i] = ObjectUtil.defaultIfNull(values[i], Character.MIN_VALUE);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user