File tree 2 files changed +23
-1
lines changed
main/kotlin/io/github/projectmapk/jackson/module/kogera
test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public inline fun <reified T> ObjectMapper.readValue(src: ByteArray): T = readVa
62
62
63
63
public inline fun <reified T > ObjectMapper.treeToValue (n : TreeNode ): T =
64
64
readValue(this .treeAsTokens(n), jacksonTypeRef<T >())
65
- public inline fun <reified T > ObjectMapper.convertValue (from : Any ): T = convertValue(from, jacksonTypeRef<T >())
65
+ public inline fun <reified T > ObjectMapper.convertValue (from : Any? ): T = convertValue(from, jacksonTypeRef<T >())
66
66
67
67
public inline fun <reified T > ObjectReader.readValueTyped (jp : JsonParser ): T = readValue(jp, jacksonTypeRef<T >())
68
68
public inline fun <reified T > ObjectReader.readValuesTyped (jp : JsonParser ): Iterator <T > =
Original file line number Diff line number Diff line change
1
+ package io.github.projectmapk.jackson.module.kogera.zPorted.test.github
2
+
3
+ import com.fasterxml.jackson.databind.json.JsonMapper
4
+ import io.github.projectmapk.jackson.module.kogera.KotlinFeature
5
+ import io.github.projectmapk.jackson.module.kogera.KotlinModule
6
+ import io.github.projectmapk.jackson.module.kogera.convertValue
7
+ import org.junit.jupiter.api.Assertions.assertNull
8
+ import org.junit.jupiter.api.Test
9
+
10
+ class GitHub757 {
11
+ @Test
12
+ fun test () {
13
+ val kotlinModule = KotlinModule .Builder ()
14
+ .enable(KotlinFeature .StrictNullChecks )
15
+ .build()
16
+ val mapper = JsonMapper .builder()
17
+ .addModule(kotlinModule)
18
+ .build()
19
+ val convertValue = mapper.convertValue<String ?>(null )
20
+ assertNull(convertValue)
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments