-
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
Description
Search before asking
- I searched in the issues and found nothing similar.
- I have confirmed that the same problem is not reproduced if I exclude the KotlinModule.
- I searched in the issues of databind and other modules used and found nothing similar.
- I have confirmed that the problem does not reproduce in Java and only occurs when using Kotlin and KotlinModule.
Describe the bug
After upgrade 2.19.* -> 2.20.0 deserialization doesn't work, when an object references a value class with private constructor
ad custom operator invoke
.
java.lang.IllegalAccessException: member is private: mdm.model.PortCode.constructor-impl[Ljava.lang.Object;@4e6920e/invokeStatic, from class com.fasterxml.jackson.module.kotlin.InternalCommonsKt (unnamed module @38363e96)
at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:894)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkAccess(MethodHandles.java:3987)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkMethod(MethodHandles.java:3923)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:4072)
at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:4065)
at java.base/java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:3451)
at com.fasterxml.jackson.module.kotlin.InternalCommonsKt.unreflect(InternalCommons.kt:64)
at com.fasterxml.jackson.module.kotlin.NoConversionCreatorBoxDeserializer.<init>(KotlinDeserializers.kt:112)
Example of value class (work in 2.19).
@JvmInline
value class PortCode private constructor(val value: String) : Comparable<PortCode> {
companion object {
operator fun invoke(value: String) = PortCode(value.uppercase(Locale.getDefault()))
}
}
To Reproduce
// Your code here
Expected behavior
No response
Versions
Kotlin:
Jackson-module-kotlin:
Jackson-databind:
Additional context
No response