Skip to content

Commit 808486e

Browse files
committed
Organize StrictNullChecks options and update documentation
1 parent f8fa529 commit 808486e

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) {
4040
*
4141
* With this disabled, the default, collections which are typed to disallow null members (e.g. `List<String>`)
4242
* may contain null values after deserialization.
43-
* Enabling it protects against this but has significant performance impact.
43+
* Enabling this will cause an [InvalidNullException] to be thrown if null is entered.
44+
*
45+
* Internally, it will be the same as if [JsonSetter] (contentNulls = FAIL) had been granted.
46+
*
47+
* Benchmarks show that it can check for illegal nulls with throughput nearly identical to the default (see [jackson-module-kotlin#719]).
4448
*/
45-
@Deprecated(
46-
level = DeprecationLevel.ERROR,
47-
message = "This option will be migrated to the new backend in 2.21.",
48-
replaceWith = ReplaceWith("NewStrictNullChecks")
49-
)
5049
StrictNullChecks(enabledByDefault = false),
5150

5251
/**
@@ -80,15 +79,15 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) {
8079
* Internally, it will be the same as if [JsonSetter] (contentNulls = FAIL) had been granted.
8180
* Benchmarks show that it can check for illegal nulls with throughput nearly identical to the default (see [jackson-module-kotlin#719]).
8281
*
83-
* Note that in the new backend, the exception thrown has changed from [MissingKotlinParameterException] to [InvalidNullException].
84-
* The message will be changed accordingly.
85-
* Since 2.19, the base class of [MissingKotlinParameterException] has also been changed to [InvalidNullException],
86-
* so be careful when catching it.
87-
*
8882
* This is a temporary option for a phased backend migration,
8983
* which will eventually be merged into [StrictNullChecks].
9084
* Also, specifying both this and [StrictNullChecks] is not permitted.
9185
*/
86+
@Deprecated(
87+
level = DeprecationLevel.WARNING,
88+
message = "This option will be merged into StrictNullChecks in 2.23.",
89+
replaceWith = ReplaceWith("StrictNullChecks")
90+
)
9291
NewStrictNullChecks(enabledByDefault = false);
9392

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class KotlinModule private constructor(
4343
val nullToEmptyMap: Boolean = NullToEmptyMap.enabledByDefault,
4444
val nullIsSameAsDefault: Boolean = NullIsSameAsDefault.enabledByDefault,
4545
val singletonSupport: Boolean = SingletonSupport.enabledByDefault,
46-
@Suppress("DEPRECATION_ERROR")
4746
strictNullChecks: Boolean = StrictNullChecks.enabledByDefault,
4847
val kotlinPropertyNameAsImplicitName: Boolean = KotlinPropertyNameAsImplicitName.enabledByDefault,
4948
val useJavaDurationConversion: Boolean = UseJavaDurationConversion.enabledByDefault,

0 commit comments

Comments
 (0)