File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,15 @@ internal class MethodValueCreator<T> private constructor(
23
23
// abort, we have some unknown case here
24
24
if (! possibleCompanion.isCompanion) return null
25
25
26
+ val initialCallableAccessible = callable.isAccessible
27
+ if (! initialCallableAccessible) callable.isAccessible = true
28
+
26
29
val (companionObjectInstance: Any , accessible: Boolean ) = try {
27
30
// throws ex
28
31
val instance = possibleCompanion.objectInstance!!
32
+
29
33
// If an instance of the companion object can be obtained, accessibility depends on the KFunction
30
- instance to callable.isAccessible
34
+ instance to initialCallableAccessible
31
35
} catch (ex: IllegalAccessException ) {
32
36
// fallback for when an odd access exception happens through Kotlin reflection
33
37
possibleCompanion.java.enclosingClass.fields
You can’t perform that action at this time.
0 commit comments