Skip to content

Commit 5e9b549

Browse files
committed
better naming
1 parent a58b374 commit 5e9b549

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/kotlin/com/papsign/ktor/openapigen/validation/ValidationHandler.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.papsign.ktor.openapigen.validation
22

33
import com.papsign.ktor.openapigen.*
44
import com.papsign.ktor.openapigen.classLogger
5-
import org.reflections.ReflectionUtils
65
import kotlin.reflect.*
76
import kotlin.reflect.full.*
87
import kotlin.reflect.jvm.*
@@ -236,12 +235,12 @@ class ValidationHandler private constructor(
236235
transformFun = { t: Any? ->
237236
if (t != null) {
238237
val copy = t.javaClass.kotlin.memberFunctions.find { it.name == "copy" }
239-
val map = copy?.instanceParameter?.let { mutableMapOf<KParameter, Any?>(it to t) } ?: mutableMapOf()
238+
val copyParams = copy?.instanceParameter?.let { mutableMapOf<KParameter, Any?>(it to t) } ?: mutableMapOf()
240239
handled.forEach { (handler, field) ->
241240
val getter = field.kotlinProperty?.javaGetter
242241
if (copy != null && getter != null) {
243242
val param = copy.parameters.first { it.name == field.name }
244-
map[param] = handler.handle(getter(t))
243+
copyParams[param] = handler.handle(getter(t))
245244
} else {
246245
// TODO convert this to canAccess and only change status if false
247246
val accessible = field.isAccessible
@@ -250,7 +249,7 @@ class ValidationHandler private constructor(
250249
field.isAccessible = accessible
251250
}
252251
}
253-
copy?.callBy(map.toMap()) ?: t
252+
copy?.callBy(copyParams.toMap()) ?: t
254253
} else t
255254
}
256255
}

0 commit comments

Comments
 (0)