@@ -26,8 +26,6 @@ import java.lang.reflect.Constructor
26
26
import java.lang.reflect.Field
27
27
import java.lang.reflect.Method
28
28
import kotlin.reflect.KFunction
29
- import kotlin.reflect.KType
30
- import kotlin.reflect.full.createType
31
29
import kotlin.reflect.jvm.javaType
32
30
import kotlin.reflect.jvm.kotlinFunction
33
31
@@ -159,7 +157,6 @@ internal class KotlinAnnotationIntrospector(
159
157
// This could be a setter or a getter of a class property or
160
158
// a setter-like/getter-like method.
161
159
private fun AnnotatedMethod.hasRequiredMarker (): Boolean? = this .getRequiredMarkerFromCorrespondingAccessor()
162
- ? : this .member.getRequiredMarkerFromAccessorLikeMethod()
163
160
164
161
private fun AnnotatedMethod.getRequiredMarkerFromCorrespondingAccessor (): Boolean? {
165
162
val memberSignature = member.toSignature()
@@ -173,17 +170,6 @@ internal class KotlinAnnotationIntrospector(
173
170
return null
174
171
}
175
172
176
- // Is the member method a regular method of the data class or
177
- private fun Method.getRequiredMarkerFromAccessorLikeMethod (): Boolean? = this .kotlinFunction?.let { method ->
178
- val byAnnotation = this .isRequiredByAnnotation()
179
- return when {
180
- method.isSetterLike() -> requiredAnnotationOrNullability(byAnnotation, method.isMethodParameterRequired(0 ))
181
- else -> null
182
- }
183
- }
184
-
185
- private fun KFunction <* >.isSetterLike (): Boolean = parameters.size == 2 && returnType == UNIT_TYPE
186
-
187
173
private fun AnnotatedParameter.hasRequiredMarker (): Boolean? {
188
174
val member = this .member
189
175
val byAnnotation = this .getAnnotation(JsonProperty ::class .java)?.required
@@ -217,8 +203,4 @@ internal class KotlinAnnotationIntrospector(
217
203
return ! paramType.isMarkedNullable && ! param.isOptional &&
218
204
! (isPrimitive && ! context.isEnabled(DeserializationFeature .FAIL_ON_NULL_FOR_PRIMITIVES ))
219
205
}
220
-
221
- companion object {
222
- val UNIT_TYPE : KType = Unit ::class .createType()
223
- }
224
206
}
0 commit comments