Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/kotlin/tools/jackson/module/kotlin/KotlinFeature.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) {
* Internally, it will be the same as if [JsonSetter] (contentNulls = FAIL) had been granted.
*
* Benchmarks show that it can check for illegal nulls with throughput nearly identical to the default (see [jackson-module-kotlin#719]).
*
* Since 3.0, this option is enabled by default.
*/
StrictNullChecks(enabledByDefault = false),
StrictNullChecks(enabledByDefault = true),

/**
* By enabling this feature, the property name on Kotlin is used as the implicit name for the getter.
Expand Down Expand Up @@ -81,8 +83,6 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) {
* This is a temporary option for a phased backend migration,
* which will eventually be merged into [StrictNullChecks].
* Also, specifying both this and [StrictNullChecks] is not permitted.
*
* Since 3.0, this option is enabled by default.
*/
@Deprecated(
level = DeprecationLevel.WARNING,
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/tools/jackson/module/kotlin/DslTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DslTest {
enable(NullToEmptyMap)
enable(NullIsSameAsDefault)
enable(SingletonSupport)
enable(NewStrictNullChecks)
enable(KotlinFeature.StrictNullChecks)
}

assertNotNull(module)
Expand Down
10 changes: 5 additions & 5 deletions src/test/kotlin/tools/jackson/module/kotlin/KotlinModuleTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class KotlinModuleTest {
enable(StrictNullChecks)
}.strictNullChecks
)
assertTrue(kotlinModule { enable(NewStrictNullChecks) }.strictNullChecks)
assertTrue(kotlinModule { enable(StrictNullChecks) }.strictNullChecks)

assertThrows<IllegalArgumentException> {
kotlinModule {
Expand All @@ -45,7 +45,7 @@ class KotlinModuleTest {
assertFalse(module.nullToEmptyMap)
assertFalse(module.nullIsSameAsDefault)
assertTrue(module.singletonSupport)
assertFalse(module.strictNullChecks)
assertTrue(module.strictNullChecks)
assertFalse(module.kotlinPropertyNameAsImplicitName)
assertFalse(module.useJavaDurationConversion)
}
Expand All @@ -58,7 +58,7 @@ class KotlinModuleTest {
enable(NullToEmptyMap)
enable(NullIsSameAsDefault)
enable(SingletonSupport)
enable(NewStrictNullChecks)
enable(StrictNullChecks)
enable(KotlinPropertyNameAsImplicitName)
enable(UseJavaDurationConversion)
}.build()
Expand Down Expand Up @@ -112,7 +112,7 @@ class KotlinModuleTest {
@Test
fun builder_EnableStrictNullChecks() {
val module = KotlinModule.Builder().apply {
enable(NewStrictNullChecks)
enable(StrictNullChecks)
}.build()

assertTrue(module.strictNullChecks)
Expand All @@ -126,7 +126,7 @@ class KotlinModuleTest {
enable(NullToEmptyMap)
enable(NullIsSameAsDefault)
enable(SingletonSupport)
enable(NewStrictNullChecks)
enable(StrictNullChecks)
}.build()

val serialized = jdkSerialize(module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GitHub976 {
@Test
fun newStrictNullChecksRegression() {
val om = jacksonObjectMapper {
enable(KotlinFeature.NewStrictNullChecks)
enable(KotlinFeature.StrictNullChecks)
}
assertThrows<InvalidNullException> {
om.readValue("""{"list": [""] }""".toByteArray(), PrimitiveList::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlin.test.assertTrue
import kotlin.test.fail

class TestGithub27 {
val mapper = jacksonMapperBuilder { disable(KotlinFeature.NewStrictNullChecks) }
val mapper = jacksonMapperBuilder { disable(KotlinFeature.StrictNullChecks) }
.disable(SerializationFeature.INDENT_OUTPUT)
.build()

Expand Down