File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import kotlin.math.pow
6
6
/* *
7
7
* @see KotlinModule.Builder
8
8
*/
9
- enum class KotlinFeature (val enabledByDefault : Boolean ) {
9
+ enum class KotlinFeature (private val enabledByDefault : Boolean ) {
10
10
/* *
11
11
* This feature represents whether to deserialize `null` values for collection properties as empty collections.
12
12
*/
@@ -45,4 +45,11 @@ enum class KotlinFeature(val enabledByDefault: Boolean) {
45
45
StrictNullChecks (enabledByDefault = false );
46
46
47
47
internal val bitSet: BitSet = 2.0 .pow(ordinal).toInt().toBitSet()
48
+
49
+ companion object {
50
+ internal val defaults
51
+ get() = 0 .toBitSet().apply {
52
+ values().filter { it.enabledByDefault }.forEach { or (it.bitSet) }
53
+ }
54
+ }
48
55
}
Original file line number Diff line number Diff line change @@ -139,9 +139,7 @@ class KotlinModule @Deprecated(
139
139
var reflectionCacheSize: Int = 512
140
140
private set
141
141
142
- private val bitSet: BitSet = 0 .toBitSet().apply {
143
- KotlinFeature .values().filter { it.enabledByDefault }.forEach { or (it.bitSet) }
144
- }
142
+ private val bitSet: BitSet = KotlinFeature .defaults
145
143
146
144
fun withReflectionCacheSize (reflectionCacheSize : Int ): Builder = apply {
147
145
this .reflectionCacheSize = reflectionCacheSize
You can’t perform that action at this time.
0 commit comments