diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index f4cf3c66d..b2032dc13 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -41,3 +41,6 @@ Drew Stephens (dinomite@github) * Contributed fix for #281: KotlinObjectSingletonDeserializer fails to deserialize previously serialized JSON as it doesn't delegate deserializeWithType (2.11.0) + +Mateusz Stefek (MateuszStefek@github) +* Reported #321: Make MissingKotlinParameterException a descendant of MismatchedInputException diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 38b99cd92..ea265aec2 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -10,6 +10,7 @@ Project: jackson-module-kotlin - Add Builder for KotlinModule #281: Hide singleton deserialization support behind a setting on the module, `singletonSupport` and enum `SingletonSupport`. Defaults to pre-2.10 behavior. +#321: Make MissingKotlinParameterException extend MismatchedInputException Kotlin updated to 1.3.61 diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt index a95d50643..d52aa122f 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt @@ -1,10 +1,22 @@ package com.fasterxml.jackson.module.kotlin +import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.databind.JsonMappingException +import com.fasterxml.jackson.databind.exc.MismatchedInputException import java.io.Closeable import kotlin.reflect.KParameter /** - * Specialized [JsonMappingException] sub-class used to indicate that a mandatory Kotlin constructor parameter was missing or null. + * Specialized [JsonMappingException] sub-class used to indicate that a mandatory Kotlin constructor + * parameter was missing or null. */ -class MissingKotlinParameterException(val parameter: KParameter, val processor: Closeable? = null, val msg: String) : JsonMappingException(processor, msg) \ No newline at end of file +class MissingKotlinParameterException(val parameter: KParameter, + processor: JsonParser? = null, + msg: String) : MismatchedInputException(processor, msg) { + @Deprecated("Use main constructor", ReplaceWith("MissingKotlinParameterException(KParameter, JsonParser?, String)")) + constructor( + parameter: KParameter, + processor: Closeable? = null, + msg: String + ) : this(parameter, processor as JsonParser, msg) +}