From 87d192ece69e734f677c87ab423606a24b48920e Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Wed, 11 Mar 2020 07:42:42 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E3=83=90=E3=82=B1=E3=83=84?= =?UTF-8?q?=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/com/mapk/kmapper/KMapper.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/mapk/kmapper/KMapper.kt b/src/main/kotlin/com/mapk/kmapper/KMapper.kt index d22fd24..b6d7b6c 100644 --- a/src/main/kotlin/com/mapk/kmapper/KMapper.kt +++ b/src/main/kotlin/com/mapk/kmapper/KMapper.kt @@ -57,7 +57,7 @@ class KMapper private constructor( parameterMap[alias ?: property.name]?.let { // javaGetterを呼び出す方が高速 javaGetter.isAccessible = true - argumentBucket.setArgument(it.param, javaGetter.invoke(src)?.let { value -> mapObject(it, value) }) + argumentBucket.putIfAbsent(it.param, javaGetter.invoke(src)?.let { value -> mapObject(it, value) }) // 終了判定 if (argumentBucket.isInitialized) return } @@ -68,7 +68,7 @@ class KMapper private constructor( src.forEach { (key, value) -> parameterMap[key]?.let { param -> // 取得した内容がnullでなければ適切にmapする - argumentBucket.setArgument(param.param, value?.let { mapObject(param, it) }) + argumentBucket.putIfAbsent(param.param, value?.let { mapObject(param, it) }) // 終了判定 if (argumentBucket.isInitialized) return } @@ -77,7 +77,7 @@ class KMapper private constructor( private fun bindArguments(argumentBucket: ArgumentBucket, srcPair: Pair<*, *>) { parameterMap[srcPair.first.toString()]?.let { - argumentBucket.setArgument(it.param, srcPair.second?.let { value -> mapObject(it, value) }) + argumentBucket.putIfAbsent(it.param, srcPair.second?.let { value -> mapObject(it, value) }) } } From 6a7618d68b4151c58daad508489b0d1fd2eed0df Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Wed, 11 Mar 2020 08:41:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?shared=E3=82=92=E3=82=A2=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2be26da..65221ed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,7 +30,7 @@ repositories { dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation(kotlin("reflect")) - implementation("com.github.ProjectMapK:Shared:0.4") + implementation("com.github.ProjectMapK:Shared:0.5") // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter testImplementation(group = "org.junit.jupiter", name = "junit-jupiter", version = "5.6.0") {