Skip to content

Commit a2ac09a

Browse files
committed
fix to use arrayOfNulls
1 parent 3089e92 commit a2ac09a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal class BucketGenerator private constructor(
4646
fun forConstructor(parameters: List<KParameter>): BucketGenerator {
4747
val paramSize = parameters.size
4848
// Since the constructor does not require any instance parameters, do not operation the values.
49-
return BucketGenerator(paramSize, Array(paramSize) { null }, getOriginalMasks(paramSize), 0, parameters)
49+
return BucketGenerator(paramSize, arrayOfNulls(paramSize), getOriginalMasks(paramSize), 0, parameters)
5050
}
5151

5252
/**
@@ -59,7 +59,7 @@ internal class BucketGenerator private constructor(
5959

6060
// In the jackson-module-kotlin process, instance parameters are always at the top,
6161
// so they should be placed at the top of originalValues.
62-
val originalValues = Array<Any?>(paramSize) { null }.apply { this[0] = instance }
62+
val originalValues = arrayOfNulls<Any?>(paramSize).apply { this[0] = instance }
6363
// Since the instance parameters have already been initialized,
6464
// the originalMasks must also be in the corresponding state.
6565
val originalMasks = getOriginalMasks(paramSize).apply { this[0] = this[0] and 1.inv() }

0 commit comments

Comments
 (0)