This commit is contained in:
Looly
2023-08-30 22:09:12 +08:00
parent a3efec9c52
commit b0eea9f919
3 changed files with 9 additions and 9 deletions

View File

@@ -456,13 +456,7 @@ public class JSONArray implements JSON, JSONGetter<Integer>, List<Object>, Rando
}
this.rawList.add(index, InternalJSONUtil.wrap(element, this.config));
} else {
// issue#3286, 如果用户指定的index太大容易造成Java heap space错误。
// if (!config.isIgnoreNullValue()) {
// while (index != this.size()) {
// // 非末尾则填充null
// this.add(null);
// }
// }
// 相对于5.x逻辑变更当index大于size则追加而不是补充null这样更加安全
this.add(element);
}