Skip to content

Commit 879557c

Browse files
committed
Add deprecation replacement for KotlinModule constructor
1 parent 4923608 commit 879557c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,21 @@ fun Class<*>.isKotlinClass(): Boolean {
3232
* (e.g. List<String>) may contain null values after deserialization. Enabling it
3333
* protects against this but has significant performance impact.
3434
*/
35-
class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use KotlinModule.Builder") constructor(
35+
class KotlinModule @Deprecated(
36+
level = DeprecationLevel.WARNING,
37+
message = "Use KotlinModule.Builder instead of named constructor parameters.",
38+
replaceWith = ReplaceWith(
39+
"""KotlinModule.Builder()
40+
.withReflectionCacheSize(reflectionCacheSize)
41+
.configure(KotlinFeature.NullToEmptyCollection, nullToEmptyCollection)
42+
.configure(KotlinFeature.NullToEmptyMap, nullToEmptyMap)
43+
.configure(KotlinFeature.NullIsSameAsDefault, nullIsSameAsDefault)
44+
.configure(KotlinFeature.SingletonSupport, singletonSupport)
45+
.configure(KotlinFeature.StrictNullChecks, strictNullChecks)
46+
.build()""",
47+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
48+
)
49+
) constructor(
3650
val reflectionCacheSize: Int = 512,
3751
val nullToEmptyCollection: Boolean = false,
3852
val nullToEmptyMap: Boolean = false,

0 commit comments

Comments
 (0)