File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin/deser/value_instantiator/creator Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,20 @@ internal sealed class ValueCreator<T> {
29
29
30
30
fun generateBucket (): ArgumentBucket = bucketGenerator.generate()
31
31
32
+ private val accessibilityChecker: (DeserializationContext ) -> Boolean by lazy {
33
+ return @lazy if (isAccessible) {
34
+ { ctxt -> ctxt.config.isEnabled(MapperFeature .OVERRIDE_PUBLIC_ACCESS_MODIFIERS ) }
35
+ } else {
36
+ { ctxt -> ctxt.config.isEnabled(MapperFeature .CAN_OVERRIDE_ACCESS_MODIFIERS ) }
37
+ }
38
+ }
39
+
32
40
/* *
33
41
* Checking process to see if access from context is possible.
34
42
* @throws IllegalAccessException
35
43
*/
36
44
fun checkAccessibility (ctxt : DeserializationContext ) {
37
- if ((! isAccessible && ctxt.config.isEnabled(MapperFeature .CAN_OVERRIDE_ACCESS_MODIFIERS )) ||
38
- (isAccessible && ctxt.config.isEnabled(MapperFeature .OVERRIDE_PUBLIC_ACCESS_MODIFIERS ))
39
- ) {
45
+ if (accessibilityChecker(ctxt)) {
40
46
return
41
47
}
42
48
You can’t perform that action at this time.
0 commit comments