Skip to content

Commit 4270c1a

Browse files
committed
Default arguments were modified to use the specified values as much as possible
To ensure that defaults are not forgotten when they are changed.
1 parent f075e75 commit 4270c1a

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import java.util.BitSet
55
/**
66
* @see KotlinModule.Builder
77
*/
8-
enum class KotlinFeature(private val enabledByDefault: Boolean) {
8+
enum class KotlinFeature(internal val enabledByDefault: Boolean) {
99
/**
1010
* This feature represents whether to deserialize `null` values for collection properties as empty collections.
1111
*/

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ class KotlinModule @Deprecated(
4747
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
4848
)
4949
) constructor(
50-
val reflectionCacheSize: Int = 512,
51-
val nullToEmptyCollection: Boolean = false,
52-
val nullToEmptyMap: Boolean = false,
53-
val nullIsSameAsDefault: Boolean = false,
50+
val reflectionCacheSize: Int = Builder.DEFAULT_CACHE_SIZE,
51+
val nullToEmptyCollection: Boolean = NullToEmptyCollection.enabledByDefault,
52+
val nullToEmptyMap: Boolean = NullToEmptyMap.enabledByDefault,
53+
val nullIsSameAsDefault: Boolean = NullIsSameAsDefault.enabledByDefault,
5454
val singletonSupport: SingletonSupport = DISABLED,
55-
val strictNullChecks: Boolean = false,
56-
val useKotlinPropertyNameForGetter: Boolean = false,
57-
val useJavaDurationConversion: Boolean = false,
55+
val strictNullChecks: Boolean = StrictNullChecks.enabledByDefault,
56+
val useKotlinPropertyNameForGetter: Boolean = KotlinPropertyNameAsImplicitName.enabledByDefault,
57+
val useJavaDurationConversion: Boolean = UseJavaDurationConversion.enabledByDefault,
5858
) : SimpleModule(KotlinModule::class.java.name, PackageVersion.VERSION) {
5959
companion object {
6060
// Increment when option is added
@@ -155,7 +155,11 @@ class KotlinModule @Deprecated(
155155
}
156156

157157
class Builder {
158-
var reflectionCacheSize: Int = 512
158+
companion object {
159+
internal const val DEFAULT_CACHE_SIZE = 512
160+
}
161+
162+
var reflectionCacheSize: Int = DEFAULT_CACHE_SIZE
159163
private set
160164

161165
private val bitSet: BitSet = KotlinFeature.defaults

0 commit comments

Comments
 (0)