Skip to content

Commit 5b1c85d

Browse files
committed
Fix deprecation replacements
1 parent 0eeffb8 commit 5b1c85d

File tree

1 file changed

+41
-11
lines changed

1 file changed

+41
-11
lines changed

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

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,52 +150,73 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
150150

151151
@Deprecated(
152152
message = "Deprecated, use withReflectionCacheSize(reflectionCacheSize) instead.",
153-
replaceWith = ReplaceWith("isEnabled(reflectionCacheSize)")
153+
replaceWith = ReplaceWith("withReflectionCacheSize(reflectionCacheSize)")
154154
)
155155
fun reflectionCacheSize(reflectionCacheSize: Int) = apply {
156156
this.reflectionCacheSize = reflectionCacheSize
157157
}
158158

159159
@Deprecated(
160160
message = "Deprecated, use isEnabled(NullToEmptyCollection) instead.",
161-
replaceWith = ReplaceWith("isEnabled(NullToEmptyCollection)")
161+
replaceWith = ReplaceWith(
162+
"isEnabled(KotlinFeature.NullToEmptyCollection)",
163+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
164+
)
162165
)
163166
fun getNullToEmptyCollection() = isEnabled(NullToEmptyCollection)
164167

165168
@Deprecated(
166169
message = "Deprecated, use configure(NullToEmptyCollection, enabled) instead.",
167-
replaceWith = ReplaceWith("configure(NullToEmptyCollection, enabled)")
170+
replaceWith = ReplaceWith(
171+
"configure(KotlinFeature.NullToEmptyCollection, nullToEmptyCollection)",
172+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
173+
)
168174
)
169175
fun nullToEmptyCollection(nullToEmptyCollection: Boolean) =
170176
configure(NullToEmptyCollection, nullToEmptyCollection)
171177

172178
@Deprecated(
173179
message = "Deprecated, use isEnabled(NullToEmptyMap) instead.",
174-
replaceWith = ReplaceWith("isEnabled(NullToEmptyMap)")
180+
replaceWith = ReplaceWith(
181+
"isEnabled(KotlinFeature.NullToEmptyMap)",
182+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
183+
)
175184
)
176185
fun getNullToEmptyMap() = isEnabled(NullToEmptyMap)
177186

178187
@Deprecated(
179188
message = "Deprecated, use configure(NullToEmptyMap, enabled) instead.",
180-
replaceWith = ReplaceWith("configure(NullToEmptyMap, enabled)")
189+
replaceWith = ReplaceWith(
190+
"configure(KotlinFeature.NullToEmptyMap, nullToEmptyMap)",
191+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
192+
)
181193
)
182194
fun nullToEmptyMap(nullToEmptyMap: Boolean) = configure(NullToEmptyMap, nullToEmptyMap)
183195

184196
@Deprecated(
185197
message = "Deprecated, use isEnabled(NullIsSameAsDefault) instead.",
186-
replaceWith = ReplaceWith("isEnabled(NullIsSameAsDefault)")
198+
replaceWith = ReplaceWith(
199+
"isEnabled(KotlinFeature.NullIsSameAsDefault)",
200+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
201+
)
187202
)
188203
fun getNullIsSameAsDefault() = isEnabled(NullIsSameAsDefault)
189204

190205
@Deprecated(
191206
message = "Deprecated, use configure(NullIsSameAsDefault, enabled) instead.",
192-
replaceWith = ReplaceWith("configure(NullIsSameAsDefault, enabled)")
207+
replaceWith = ReplaceWith(
208+
"configure(KotlinFeature.NullIsSameAsDefault, nullIsSameAsDefault)",
209+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
210+
)
193211
)
194212
fun nullIsSameAsDefault(nullIsSameAsDefault: Boolean) = configure(NullIsSameAsDefault, nullIsSameAsDefault)
195213

196214
@Deprecated(
197215
message = "Deprecated, use isEnabled(SingletonSupport) instead.",
198-
replaceWith = ReplaceWith("isEnabled(SingletonSupport)")
216+
replaceWith = ReplaceWith(
217+
"isEnabled(KotlinFeature.SingletonSupport)",
218+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
219+
)
199220
)
200221
fun getSingletonSupport() = when {
201222
isEnabled(KotlinFeature.SingletonSupport) -> CANONICALIZE
@@ -204,7 +225,10 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
204225

205226
@Deprecated(
206227
message = "Deprecated, use configure(SingletonSupport, enabled) instead.",
207-
replaceWith = ReplaceWith("configure(SingletonSupport, enabled)")
228+
replaceWith = ReplaceWith(
229+
"configure(KotlinFeature.SingletonSupport, singletonSupport)",
230+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
231+
)
208232
)
209233
fun singletonSupport(singletonSupport: SingletonSupport) = when (singletonSupport) {
210234
CANONICALIZE -> enable(KotlinFeature.SingletonSupport)
@@ -213,13 +237,19 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
213237

214238
@Deprecated(
215239
message = "Deprecated, use isEnabled(StrictNullChecks) instead.",
216-
replaceWith = ReplaceWith("isEnabled(StrictNullChecks)")
240+
replaceWith = ReplaceWith(
241+
"isEnabled(KotlinFeature.StrictNullChecks)",
242+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
243+
)
217244
)
218245
fun getStrictNullChecks() = isEnabled(StrictNullChecks)
219246

220247
@Deprecated(
221248
message = "Deprecated, use configure(StrictNullChecks, enabled) instead.",
222-
replaceWith = ReplaceWith("configure(StrictNullChecks, enabled)")
249+
replaceWith = ReplaceWith(
250+
"configure(KotlinFeature.StrictNullChecks, strictNullChecks)",
251+
"com.fasterxml.jackson.module.kotlin.KotlinFeature"
252+
)
223253
)
224254
fun strictNullChecks(strictNullChecks: Boolean) = configure(StrictNullChecks, strictNullChecks)
225255

0 commit comments

Comments
 (0)