File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,15 @@ internal class ReflectionCache(reflectionCacheSize: Int) : Serializable {
59
59
private val valueClassBoxConverterCache: LRUMap <KClass <* >, ValueClassBoxConverter <* , * >> =
60
60
LRUMap (0 , reflectionCacheSize)
61
61
62
- fun kotlinFromJava (key : Constructor <* >): KFunction <* >? = javaExecutableToKotlin.get(key)
63
- ? : key.valueClassAwareKotlinFunction()?.let { javaExecutableToKotlin.putIfAbsent(key, it) ? : it }
62
+ // If the Record type defined in Java is processed,
63
+ // an error will occur, so if it is not defined in Kotlin, skip the process.
64
+ // see https://github.com/FasterXML/jackson-module-kotlin/issues/778
65
+ fun kotlinFromJava (key : Constructor <* >): KFunction <* >? = if (key.declaringClass.isKotlinClass()) {
66
+ javaExecutableToKotlin.get(key)
67
+ ? : key.valueClassAwareKotlinFunction()?.let { javaExecutableToKotlin.putIfAbsent(key, it) ? : it }
68
+ } else {
69
+ null
70
+ }
64
71
65
72
fun kotlinFromJava (key : Method ): KFunction <* >? = javaExecutableToKotlin.get(key)
66
73
? : key.kotlinFunction?.let { javaExecutableToKotlin.putIfAbsent(key, it) ? : it }
You can’t perform that action at this time.
0 commit comments