File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,8 @@ private fun KFunction<*>.isPossibleCreator(propertyNames: Set<String>): Boolean
124
124
&& ! isPossibleSingleString(propertyNames)
125
125
&& parameters.none { it.name == null }
126
126
127
- private fun KFunction <* >.isPossibleSingleString (propertyNames : Set <String >): Boolean = parameters.size == 1 &&
128
- parameters[0 ].name !in propertyNames &&
129
- parameters[0 ].type.javaType == String ::class .java &&
130
- ! parameters[0 ].hasAnnotation<JsonProperty >()
127
+ private fun KFunction <* >.isPossibleSingleString (propertyNames : Set <String >): Boolean = parameters.singleOrNull()?.let {
128
+ it.name !in propertyNames
129
+ && it.type.javaType == String ::class .java
130
+ && ! it.hasAnnotation<JsonProperty >()
131
+ } == true
You can’t perform that action at this time.
0 commit comments