Skip to content

Commit c307ad4

Browse files
committed
Merge remote-tracking branch 'FasterXML/2.17' into 2.18
2 parents c327a19 + 0b6320f commit c307ad4

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

release-notes/CREDITS-2.x

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ Contributors:
1818
# 2.18.0 (not yet released)
1919
* #782: Organize deprecated contents
2020

21-
# 2.17.1 (not yet released)
21+
# 2.17.2 (not yet released)
22+
23+
WrongWrong (@k163377)
24+
* #799: Fixed problem with code compiled with 2.17.x losing backward compatibility.
25+
26+
# 2.17.1 (04-May-2024)
2227

2328
WrongWrong (@k163377)
2429
* #776: Delete Duration conversion that was no longer needed

release-notes/VERSION-2.x

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Co-maintainers:
2222
Several constructors and accessors to properties of KotlinModule.Builder that were marked as DeprecationLevel.ERROR have been removed.
2323
Also, the content marked as DeprecationLevel.WARNING is now DeprecationLevel.ERROR.
2424

25+
2.17.2 (not yet released)
26+
#799: Fixed problem with code compiled with 2.17.x losing backward compatibility.
27+
2528
2.17.1 (04-May-2024)
2629

2730
#776: Delete Duration conversion that was no longer needed.

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ fun jsonMapper(initializer: JsonMapper.Builder.() -> Unit = {}): JsonMapper {
3333
return builder.build()
3434
}
3535

36-
// region: JvmOverloads is set for bytecode compatibility for versions below 2.17.
37-
@JvmOverloads
36+
// region: Do not remove the default argument for functions that take a builder as an argument for compatibility.
37+
// The default argument can be removed in 2.21 or later. See #775 for the history.
38+
fun jacksonObjectMapper(): ObjectMapper = jsonMapper { addModule(kotlinModule()) }
3839
fun jacksonObjectMapper(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper =
3940
jsonMapper { addModule(kotlinModule(initializer)) }
40-
@JvmOverloads
41+
42+
fun jacksonMapperBuilder(): JsonMapper.Builder = JsonMapper.builder().addModule(kotlinModule())
4143
fun jacksonMapperBuilder(initializer: KotlinModule.Builder.() -> Unit = {}): JsonMapper.Builder =
4244
JsonMapper.builder().addModule(kotlinModule(initializer))
4345

44-
@JvmOverloads
46+
fun ObjectMapper.registerKotlinModule(): ObjectMapper = this.registerModule(kotlinModule())
4547
fun ObjectMapper.registerKotlinModule(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper =
4648
this.registerModule(kotlinModule(initializer))
4749
// endregion

0 commit comments

Comments
 (0)