We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7fbcc4 commit a4338baCopy full SHA for a4338ba
src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt
@@ -71,7 +71,7 @@ internal class KotlinValueInstantiator(
71
possibleCompanion.objectInstance
72
} catch (ex: IllegalAccessException) {
73
// fallback for when an odd access exception happens through Kotlin reflection
74
- val companionField = possibleCompanion.java.enclosingClass.fields.firstOrNull { it.name == "Companion" }
+ val companionField = possibleCompanion.java.enclosingClass.fields.firstOrNull { it.type.kotlin.isCompanion }
75
?: throw ex
76
val accessible = companionField.isAccessible
77
if ((!accessible && ctxt.config.isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS)) ||
0 commit comments