json-iterator / java

jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
http://jsoniter.com/
MIT License
1.51k stars 519 forks source link

java 17 NPE #332

Open ozkanpakdil opened 1 year ago

ozkanpakdil commented 1 year ago

I was trying to run https://github.com/fabienrenaud/java-json-benchmark with java 17 then I got error below

java.lang.NullPointerException: Cannot invoke "com.jsoniter.spi.Decoder.decode(com.jsoniter.JsonIterator)" because "decoder" is null
    at com.jsoniter.Codegen$1.decode(Codegen.java:115)
    at com.jsoniter.JsonIterator.read(JsonIterator.java:385)
    at com.jsoniter.JsonIterator.read(JsonIterator.java:375)
    at com.jsoniter.JsonIterator.deserialize(JsonIterator.java:441)
    at com.github.fabienrenaud.jjb.databind.Deserialization.jsoniter(Deserialization.java:137)
    at com.github.fabienrenaud.jjb.databind.jmh_generated.Deserialization_jsoniter_jmhTest.jsoniter_Throughput(Deserialization_jsoniter_jmhTest.java:78)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:475)
    at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:458)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

can see more details here https://github.com/ozkanpakdil/java-json-benchmark/blob/899e5f7cedc288926585d271f3c4cfe1e44cb7e7/output/clients-deser-1-1.txt#L400

more details how the test run https://github.com/ozkanpakdil/java-json-benchmark/blob/master/run-everything