Skip to content

Commit

Permalink
Gradle: Upgrade to Jackson 2.11.1
Browse files Browse the repository at this point in the history
See https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.11.1.

This fixes #2796 by applying the work-around described at [1] to enums as
our Jackson version was actually already being upgraded to version 2.11.0
by Gradle via the Antenna dependency.

[1] FasterXML/jackson-module-kotlin#336 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jun 29, 2020
1 parent 1ba51c8 commit b16c6c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions clearly-defined/src/main/kotlin/Enums.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum class ComponentType(val value: String) {
DEBIAN_SOURCES("debsrc");

companion object {
@JsonCreator
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
@JvmStatic
fun fromString(value: String) =
enumValues<ComponentType>().single { value.equals(it.value, ignoreCase = true) }
Expand All @@ -66,7 +66,7 @@ enum class Provider(val value: String) {
DEBIAN("debian");

companion object {
@JsonCreator
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
@JvmStatic
fun fromString(value: String) = enumValues<Provider>().single { value.equals(it.value, ignoreCase = true) }
}
Expand All @@ -83,7 +83,7 @@ enum class Nature {
NOTICE;

companion object {
@JsonCreator
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
@JvmStatic
fun fromString(value: String) = enumValues<Nature>().single { value.equals(it.name, ignoreCase = true) }
}
Expand All @@ -103,7 +103,7 @@ enum class ContributionType {
OTHER;

companion object {
@JsonCreator
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
@JvmStatic
fun fromString(value: String) =
enumValues<ContributionType>().single { value.equals(it.name, ignoreCase = true) }
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ digraphVersion = 1.0
disklrucacheVersion = 2.0.2
flexmarkVersion = 0.62.2
hamcrestCoreVersion = 1.3
jacksonVersion = 2.10.3
jacksonVersion = 2.11.1
jgitVersion = 5.8.0.202006091008-r
jSchAgentProxyVersion = 0.0.7
kotestVersion = 4.0.5
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/HashAlgorithm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ enum class HashAlgorithm(private vararg val aliases: String, val verifiable: Boo
/**
* Create a hash algorithm from one of its [alias] names.
*/
@JsonCreator
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
@JvmStatic
fun fromString(alias: String) =
enumValues<HashAlgorithm>().find {
Expand Down

0 comments on commit b16c6c4

Please sign in to comment.