Skip to content

Commit d29f739

Browse files
authored
321 inherit from mismatched input (#325)
Fix #321: Make MKPE descend from MismatchedInputException
1 parent f4912f8 commit d29f739

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

release-notes/CREDITS-2.x

+3
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ Drew Stephens (dinomite@github)
4747
* Contributed fix for #281: KotlinObjectSingletonDeserializer fails to deserialize
4848
previously serialized JSON as it doesn't delegate deserializeWithType
4949
(2.11.0)
50+
51+
Mateusz Stefek (MateuszStefek@github)
52+
* Reported #321: Make MissingKotlinParameterException a descendant of MismatchedInputException

release-notes/VERSION-2.x

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Project: jackson-module-kotlin
1010
- Add Builder for KotlinModule
1111
#281: Hide singleton deserialization support behind a setting on the module,
1212
`singletonSupport` and enum `SingletonSupport`. Defaults to pre-2.10 behavior.
13+
#321: Make MissingKotlinParameterException extend MismatchedInputException
1314

1415
Kotlin updated to 1.3.61
1516

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
package com.fasterxml.jackson.module.kotlin
22

3+
import com.fasterxml.jackson.core.JsonParser
34
import com.fasterxml.jackson.databind.JsonMappingException
5+
import com.fasterxml.jackson.databind.exc.MismatchedInputException
46
import java.io.Closeable
57
import kotlin.reflect.KParameter
68

79
/**
8-
* Specialized [JsonMappingException] sub-class used to indicate that a mandatory Kotlin constructor parameter was missing or null.
10+
* Specialized [JsonMappingException] sub-class used to indicate that a mandatory Kotlin constructor
11+
* parameter was missing or null.
912
*/
10-
class MissingKotlinParameterException(val parameter: KParameter, val processor: Closeable? = null, val msg: String) : JsonMappingException(processor, msg)
13+
class MissingKotlinParameterException(val parameter: KParameter,
14+
processor: JsonParser? = null,
15+
msg: String) : MismatchedInputException(processor, msg) {
16+
@Deprecated("Use main constructor", ReplaceWith("MissingKotlinParameterException(KParameter, JsonParser?, String)"))
17+
constructor(
18+
parameter: KParameter,
19+
processor: Closeable? = null,
20+
msg: String
21+
) : this(parameter, processor as JsonParser, msg)
22+
}

0 commit comments

Comments
 (0)