You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Howdy,
I'm getting the following error when parsing a Map that contains a large number of items (2387 in this case) using Jackson Jr version 2.8.3:
java.lang.ArrayIndexOutOfBoundsException: 3645
The source JSON was generated using the JSON.std.asString() function with no problem, but the result can't be parse back by the JSON.std.anyFrom() function.
Attached a file that reproduces the problem. large_map.txt
File does not contain duplicate keys, and the parsing works when I reduce the number of items in the Map down to 1822. You can also use the following code to reproduce:
public static void main(String[] args) {
int i = 0;
try {
for (i = 1; i < 3000; i++) {
testLargeJson(i);
}
} catch (Exception ex) {
System.out.println(i);
ex.printStackTrace();
}
}
private static void testLargeJson(int size) throws Exception {
Map<String, Object> map = new HashMap<>();
for (int i = 0; i < size; i++) {
map.put("" + i, new HashMap<String, Object>());
}
String output = JSON.std.asString(map);
Map json = (Map) JSON.std.anyFrom(output);
}
This crashes for i = 1823 but not before.
The text was updated successfully, but these errors were encountered:
Howdy,
I'm getting the following error when parsing a Map that contains a large number of items (2387 in this case) using Jackson Jr version 2.8.3:
The source JSON was generated using the
JSON.std.asString()
function with no problem, but the result can't be parse back by theJSON.std.anyFrom()
function.Attached a file that reproduces the problem.
large_map.txt
File does not contain duplicate keys, and the parsing works when I reduce the number of items in the Map down to 1822. You can also use the following code to reproduce:
This crashes for
i = 1823
but not before.The text was updated successfully, but these errors were encountered: