Skip to content

Commit ee079d7

Browse files
committed
Add secondary constructor that still takes Closeable?
1 parent 0ecf395 commit ee079d7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ package com.fasterxml.jackson.module.kotlin
33
import com.fasterxml.jackson.core.JsonParser
44
import com.fasterxml.jackson.databind.JsonMappingException
55
import com.fasterxml.jackson.databind.exc.MismatchedInputException
6+
import java.io.Closeable
67
import kotlin.reflect.KParameter
78

89
/**
910
* Specialized [JsonMappingException] sub-class used to indicate that a mandatory Kotlin constructor
1011
* parameter was missing or null.
1112
*/
1213
class MissingKotlinParameterException(val parameter: KParameter,
13-
val processor: JsonParser? = null,
14-
val msg: String) : MismatchedInputException(processor, msg)
14+
processor: JsonParser? = null,
15+
msg: String) : MismatchedInputException(processor, msg) {
16+
constructor(
17+
parameter: KParameter,
18+
processor: Closeable? = null,
19+
msg: String
20+
) : this(parameter, processor as JsonParser, msg)
21+
}

0 commit comments

Comments
 (0)