Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit f499eb2

Browse files
committed
パラメータの初期化方式を修正
1 parent 03d1c9b commit f499eb2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/kotlin/com/mapk/kmapper/KMapper.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ class KMapper<T : Any> private constructor(
2929
clazz.toKConstructor(parameterNameConverter), parameterNameConverter
3030
)
3131

32-
private val parameterMap: Map<String, ParameterForMap<*>> = function.parameters
33-
.filter { it.kind != KParameter.Kind.INSTANCE && !it.isUseDefaultArgument() }
34-
.associate {
35-
(parameterNameConverter(it.getAliasOrName()!!)) to ParameterForMap.newInstance(it, parameterNameConverter)
36-
}
32+
private val parameterMap: Map<String, ParameterForMap<*>> = function.requiredParameters.associate {
33+
it.name to ParameterForMap(it, parameterNameConverter)
34+
}
3735

3836
private val getCache: ConcurrentMap<KClass<*>, List<ArgumentBinder>> = ConcurrentHashMap()
3937

0 commit comments

Comments
 (0)