EsotericSoftware / kryo

Java binary serialization and cloning: fast, efficient, automatic
BSD 3-Clause "New" or "Revised" License
6.19k stars 823 forks source link

NullPointerException occured when read HashSet, in 4.0.2 #791

Closed fennuzhichui closed 3 years ago

fennuzhichui commented 3 years ago

the Exception like this Caused by: java.lang.NullPointerException at java.util.HashSet.add(HashSet.java:219) at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125

when debug the code,i found the result of kryo.newInstance(type) (CollectionSerializer#111 )is null,so why this happen? the HashSet doesn`t support kryo sede?

fennuzhichui commented 3 years ago

@puneetlakhina @timotta @matthoffman

theigl commented 3 years ago

@fennuzhichui: Please create a minimal test-case that reproduces the problem.

theigl commented 3 years ago

@fennuzhichui: Please provide a test-case or additional input. Otherwise, I'll close this ticket.