Skip to content

Commit

Permalink
Fix for review
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed Jul 22, 2023
1 parent 5b65f56 commit aa7217f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.fasterxml.jackson.module.kotlin

import java.util.BitSet
import kotlin.math.pow

/**
* @see KotlinModule.Builder
Expand Down Expand Up @@ -45,9 +44,9 @@ enum class KotlinFeature(private val enabledByDefault: Boolean) {
StrictNullChecks(enabledByDefault = false),

/**
* By enabling this feature, the property name on Kotlin will be used as the getter name.
* By enabling this feature, the property name on Kotlin is used as the implicit name for the getter.
*
* By default, the name based on the getter name on the JVM is used as the accessor name.
* By default, the getter name is used during serialization.
* This name may be different from the parameter/field name, in which case serialization results
* may be incorrect or annotations may malfunction.
* See [jackson-module-kotlin#630] for details.
Expand All @@ -57,8 +56,9 @@ enum class KotlinFeature(private val enabledByDefault: Boolean) {
* On the other hand, enabling this option increases the amount of reflection processing,
* which may result in performance degradation for both serialization and deserialization.
* In addition, the adjustment of behavior using get:JvmName is disabled.
* Note also that this feature does not apply to setters.
*/
UseKotlinPropertyNameForGetter(enabledByDefault = false);
KotlinPropertyNameAsImplicitName(enabledByDefault = false);

internal val bitSet: BitSet = (1 shl ordinal).toBitSet()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullIsSameAsDefault
import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyCollection
import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyMap
import com.fasterxml.jackson.module.kotlin.KotlinFeature.StrictNullChecks
import com.fasterxml.jackson.module.kotlin.KotlinFeature.UseKotlinPropertyNameForGetter
import com.fasterxml.jackson.module.kotlin.KotlinFeature.KotlinPropertyNameAsImplicitName
import com.fasterxml.jackson.module.kotlin.SingletonSupport.CANONICALIZE
import com.fasterxml.jackson.module.kotlin.SingletonSupport.DISABLED
import java.util.*
Expand Down Expand Up @@ -105,7 +105,7 @@ class KotlinModule @Deprecated(
else -> DISABLED
},
builder.isEnabled(StrictNullChecks),
builder.isEnabled(UseKotlinPropertyNameForGetter)
builder.isEnabled(KotlinPropertyNameAsImplicitName)
)

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.test.assertEquals

class Github630 {
private val mapper = ObjectMapper()
.registerModule(KotlinModule.Builder().enable(KotlinFeature.UseKotlinPropertyNameForGetter).build())!!
.registerModule(KotlinModule.Builder().enable(KotlinFeature.KotlinPropertyNameAsImplicitName).build())!!

data class Dto(
// from #570, #603
Expand Down

0 comments on commit aa7217f

Please sign in to comment.