From a2ac09a5739a967606b204949d0ca3d196cbedb9 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Tue, 18 Jan 2022 22:27:40 +0900 Subject: [PATCH] fix to use arrayOfNulls --- .../com/fasterxml/jackson/module/kotlin/ArgumentBucket.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ArgumentBucket.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ArgumentBucket.kt index 3a65179f..530bf0dc 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ArgumentBucket.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/ArgumentBucket.kt @@ -46,7 +46,7 @@ internal class BucketGenerator private constructor( fun forConstructor(parameters: List): BucketGenerator { val paramSize = parameters.size // Since the constructor does not require any instance parameters, do not operation the values. - return BucketGenerator(paramSize, Array(paramSize) { null }, getOriginalMasks(paramSize), 0, parameters) + return BucketGenerator(paramSize, arrayOfNulls(paramSize), getOriginalMasks(paramSize), 0, parameters) } /** @@ -59,7 +59,7 @@ internal class BucketGenerator private constructor( // In the jackson-module-kotlin process, instance parameters are always at the top, // so they should be placed at the top of originalValues. - val originalValues = Array(paramSize) { null }.apply { this[0] = instance } + val originalValues = arrayOfNulls(paramSize).apply { this[0] = instance } // Since the instance parameters have already been initialized, // the originalMasks must also be in the corresponding state. val originalMasks = getOriginalMasks(paramSize).apply { this[0] = this[0] and 1.inv() }