Skip to content

Commit

Permalink
Merge pull request #799 from k163377/fix/775
Browse files Browse the repository at this point in the history
Fixed problem with code compiled with 2.17.x losing backward compatibility
  • Loading branch information
k163377 authored May 18, 2024
2 parents 3e85ec5 + 8814e2d commit 0b6320f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ Authors:

Contributors:

# 2.17.1 (not yet released)
# 2.17.2 (not yet released)

WrongWrong (@k163377)
* #799: Fixed problem with code compiled with 2.17.x losing backward compatibility.

# 2.17.1 (04-May-2024)

WrongWrong (@k163377)
* #776: Delete Duration conversion that was no longer needed
Expand Down
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Co-maintainers:
=== Releases ===
------------------------------------------------------------------------

2.17.2 (not yet released)
#799: Fixed problem with code compiled with 2.17.x losing backward compatibility.

2.17.1 (04-May-2024)

#776: Delete Duration conversion that was no longer needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ fun jsonMapper(initializer: JsonMapper.Builder.() -> Unit = {}): JsonMapper {
return builder.build()
}

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

fun jacksonMapperBuilder(): JsonMapper.Builder = JsonMapper.builder().addModule(kotlinModule())
fun jacksonMapperBuilder(initializer: KotlinModule.Builder.() -> Unit = {}): JsonMapper.Builder =
JsonMapper.builder().addModule(kotlinModule(initializer))

@JvmOverloads
fun ObjectMapper.registerKotlinModule(): ObjectMapper = this.registerModule(kotlinModule())
fun ObjectMapper.registerKotlinModule(initializer: KotlinModule.Builder.() -> Unit = {}): ObjectMapper =
this.registerModule(kotlinModule(initializer))
// endregion
Expand Down

0 comments on commit 0b6320f

Please sign in to comment.