|
1 | 1 | /*
|
2 |
| - * Copyright (C) 2015, 2017, 2021 XStream Committers. |
| 2 | + * Copyright (C) 2015, 2017, 2021, 2024 XStream Committers. |
3 | 3 | * All rights reserved.
|
4 | 4 | *
|
5 | 5 | * The software in this package is published under the terms of the BSD
|
|
18 | 18 | import java.util.List;
|
19 | 19 | import java.util.concurrent.TimeUnit;
|
20 | 20 |
|
| 21 | +import org.codehaus.jettison.json.JSONObject; |
21 | 22 | import org.openjdk.jmh.annotations.Benchmark;
|
22 | 23 | import org.openjdk.jmh.annotations.BenchmarkMode;
|
23 | 24 | import org.openjdk.jmh.annotations.Fork;
|
|
69 | 70 | @Threads(1)
|
70 | 71 | @Warmup(iterations = 5)
|
71 | 72 | public class ParserBenchmark {
|
| 73 | + { |
| 74 | + // Increase max recursion depth for Jettison |
| 75 | + JSONObject.setGlobalRecursionDepthLimit(2000); |
| 76 | + } |
72 | 77 |
|
73 | 78 | /**
|
74 | 79 | * Driver factory. Enum values used as parameter for the parser benchmark methods.
|
@@ -229,7 +234,7 @@ public void checkData(final Object o) {
|
229 | 234 | }
|
230 | 235 | },
|
231 | 236 | /**
|
232 |
| - * Nested list in list structure, 500 elements deep. |
| 237 | + * Nested list in list structure, 1000 elements deep. |
233 | 238 | *
|
234 | 239 | * @author Jörg Schaible
|
235 | 240 | * @since 1.4.9
|
@@ -331,6 +336,7 @@ public void init() {
|
331 | 336 | xstream.addPermission(PrimitiveTypePermission.PRIMITIVES);
|
332 | 337 | xstream.allowTypes(List.class, String.class);
|
333 | 338 | xstream.setMode(XStream.NO_REFERENCES);
|
| 339 | + xstream.setCollectionUpdateLimit(0); |
334 | 340 | driver = driverFactory.getDriver();
|
335 | 341 | }
|
336 | 342 |
|
|
0 commit comments