mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix bug
This commit is contained in:
parent
5c2a48fee4
commit
a3efec9c52
@ -456,12 +456,13 @@ public class JSONArray implements JSON, JSONGetter<Integer>, List<Object>, Rando
|
||||
}
|
||||
this.rawList.add(index, InternalJSONUtil.wrap(element, this.config));
|
||||
} else {
|
||||
if (!config.isIgnoreNullValue()) {
|
||||
while (index != this.size()) {
|
||||
// 非末尾,则填充null
|
||||
this.add(null);
|
||||
}
|
||||
}
|
||||
// issue#3286, 如果用户指定的index太大,容易造成Java heap space错误。
|
||||
// if (!config.isIgnoreNullValue()) {
|
||||
// while (index != this.size()) {
|
||||
// // 非末尾,则填充null
|
||||
// this.add(null);
|
||||
// }
|
||||
// }
|
||||
this.add(element);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user