Skip to content

Commit 6ab899e

Browse files
committed
Remove unnecessary functions
1 parent 9660245 commit 6ab899e

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import java.lang.reflect.Constructor
2626
import java.lang.reflect.Field
2727
import java.lang.reflect.Method
2828
import kotlin.reflect.KFunction
29-
import kotlin.reflect.KType
30-
import kotlin.reflect.full.createType
3129
import kotlin.reflect.jvm.javaType
3230
import kotlin.reflect.jvm.kotlinFunction
3331

@@ -159,7 +157,6 @@ internal class KotlinAnnotationIntrospector(
159157
// This could be a setter or a getter of a class property or
160158
// a setter-like/getter-like method.
161159
private fun AnnotatedMethod.hasRequiredMarker(): Boolean? = this.getRequiredMarkerFromCorrespondingAccessor()
162-
?: this.member.getRequiredMarkerFromAccessorLikeMethod()
163160

164161
private fun AnnotatedMethod.getRequiredMarkerFromCorrespondingAccessor(): Boolean? {
165162
val memberSignature = member.toSignature()
@@ -173,17 +170,6 @@ internal class KotlinAnnotationIntrospector(
173170
return null
174171
}
175172

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-
187173
private fun AnnotatedParameter.hasRequiredMarker(): Boolean? {
188174
val member = this.member
189175
val byAnnotation = this.getAnnotation(JsonProperty::class.java)?.required
@@ -217,8 +203,4 @@ internal class KotlinAnnotationIntrospector(
217203
return !paramType.isMarkedNullable && !param.isOptional &&
218204
!(isPrimitive && !context.isEnabled(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES))
219205
}
220-
221-
companion object {
222-
val UNIT_TYPE: KType = Unit::class.createType()
223-
}
224206
}

0 commit comments

Comments
 (0)