Describe the bug
When serializing an object in Kotlin it fails with an ArrayIndexOutOfBoundsException
Exception in thread "main" com.esotericsoftware.kryo.KryoException: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
Serialization trace:
definition (org.koin.core.definition.BeanDefinition)
at com.esotericsoftware.kryo.serializers.ReflectField.write(ReflectField.java:101)
at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:108)
at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:711)
at KryoBeanDefinitionKt.main(KryoBeanDefinition.kt:31)
at KryoBeanDefinitionKt.main(KryoBeanDefinition.kt)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at com.esotericsoftware.kryo.util.DefaultGenerics.pushTypeVariables(DefaultGenerics.java:116)
at com.esotericsoftware.kryo.serializers.FieldSerializer.pushTypeVariables(FieldSerializer.java:147)
at com.esotericsoftware.kryo.serializers.FieldSerializer.write(FieldSerializer.java:102)
at com.esotericsoftware.kryo.Kryo.writeObject(Kryo.java:642)
at com.esotericsoftware.kryo.serializers.ReflectField.write(ReflectField.java:70)
... 4 more
Process finished with exit code 1
To Reproduce
I've created a minimal example in https://github.com/holgerbrandl/kryo-koin. The respective class to reproduce the stacktrace from above is KryoBeanDefinitionKt#main
Environment:
- OS: Windows 10
- JDK Version: 11
- Kryo Version: 5.2.0
Analysis
It seems to be a mismatch between the array sizes of args and hierarchy in
I've tried, but did not manage to narrow down the problem any further.
Describe the bug
When serializing an object in Kotlin it fails with an ArrayIndexOutOfBoundsException
To Reproduce
I've created a minimal example in https://github.com/holgerbrandl/kryo-koin. The respective class to reproduce the stacktrace from above is
KryoBeanDefinitionKt#mainEnvironment:
Analysis
It seems to be a mismatch between the array sizes of
argsandhierarchyinkryo/src/com/esotericsoftware/kryo/util/DefaultGenerics.java
Line 116 in 76c5e5d
I've tried, but did not manage to narrow down the problem any further.