Skip to content

Commit 9b375ff

Browse files
committed
Merge branch '2.19'
2 parents 55ce6f5 + 60fe281 commit 9b375ff

File tree

9 files changed

+18
-9
lines changed

9 files changed

+18
-9
lines changed

release-notes/CREDITS-2.x

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ WrongWrong (@k163377)
3030
* #839: Remove useKotlinPropertyNameForGetter and unify with kotlinPropertyNameAsImplicitName
3131
* #835: Remove old SingletonSupport class and unified with KotlinFeature.SingletonSupport
3232

33-
# 2.18.3 (not yet released)
33+
# 2.18.4 (not yet released)
34+
35+
WrongWrong (@k163377)
36+
* #920: Minor refactors that do not affect behavior
37+
38+
# 2.18.3 (28-Feb-2025)
3439

3540
WrongWrong (@k163377)
3641
* #908: Additional fixes related to #904.

release-notes/VERSION-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Co-maintainers:
3636
#839: Remove useKotlinPropertyNameForGetter and unify with kotlinPropertyNameAsImplicitName.
3737
#835: Remove old SingletonSupport class and unified with KotlinFeature.SingletonSupport.
3838

39+
2.18.4 (not yet released)
40+
41+
#920: Minor refactorings were made that did not affect behavior.
42+
3943
2.18.3 (28-Feb-2025)
4044

4145
#904: Fixed a problem where context was not being propagated properly when serializing an unboxed value of `value class`

src/main/kotlin/tools/jackson/module/kotlin/KotlinAnnotationIntrospector.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal class KotlinAnnotationIntrospector(
5656
}
5757
else -> null
5858
}
59-
} catch (ex: UnsupportedOperationException) {
59+
} catch (_: UnsupportedOperationException) {
6060
null
6161
}
6262
}
@@ -111,7 +111,7 @@ internal class KotlinAnnotationIntrospector(
111111
}
112112

113113
private fun AccessibleObject.isRequiredByAnnotation(): Boolean? = annotations
114-
?.firstOrNull { it.annotationClass == JsonProperty::class }
114+
.firstOrNull { it.annotationClass == JsonProperty::class }
115115
?.let { it as JsonProperty }
116116
?.required
117117

src/main/kotlin/tools/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ internal class KotlinNamesAnnotationIntrospector(
5656

5757
return member.member.declaringClass.takeIf { it.isKotlinClass() }?.let { clazz ->
5858
// For edge case, methods must be compared by name, not directly.
59-
clazz.kotlin.memberProperties.find { it.javaGetter?.name == getterName }
60-
?.let { it.name }
59+
clazz.kotlin.memberProperties.find { it.javaGetter?.name == getterName }?.name
6160
}
6261
}
6362

src/main/kotlin/tools/jackson/module/kotlin/KotlinValueDeserializerModifier.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import tools.jackson.databind.deser.ValueDeserializerModifier
77

88
// [module-kotlin#225]: keep Kotlin singletons as singletons
99
object KotlinValueDeserializerModifier : ValueDeserializerModifier() {
10+
private fun readResolve(): Any = KotlinValueDeserializerModifier
11+
1012
override fun modifyDeserializer(
1113
config: DeserializationConfig,
1214
beanDesc: BeanDescription,

src/main/kotlin/tools/jackson/module/kotlin/MethodValueCreator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package tools.jackson.module.kotlin
22

33
import kotlin.reflect.KFunction
4-
import kotlin.reflect.KParameter
54
import kotlin.reflect.full.extensionReceiverParameter
65
import kotlin.reflect.full.instanceParameter
76
import kotlin.reflect.jvm.isAccessible

src/main/kotlin/tools/jackson/module/kotlin/ReflectionCache.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private fun Constructor<*>.valueClassAwareKotlinFunction(): KFunction<*>? {
170170
declaringClass
171171
.getDeclaredConstructor(*parameterTypes, defaultConstructorMarker)
172172
.kotlinFunction
173-
} catch (t: Throwable) {
173+
} catch (_: Throwable) {
174174
null
175175
}
176176
}

src/test/kotlin/tools/jackson/module/kotlin/test/KotlinFeatures.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ private class TestM11Changes {
191191
try {
192192
person.phone
193193
fail("While person can be deserialized without a phone, phone must be set before attempting to access it")
194-
} catch (e: IllegalStateException) { // expected
194+
} catch (_: IllegalStateException) { // expected
195195
}
196196
}
197197

src/test/kotlin/tools/jackson/module/kotlin/test/github/Github161.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TestGithub161 {
2020
try {
2121
objectMapper.readValue(json, Foo::class.java)
2222
fail("Expected an error on the missing primitive value")
23-
} catch (ex: MismatchedInputException) {
23+
} catch (_: MismatchedInputException) {
2424
// success
2525
}
2626
}

0 commit comments

Comments
 (0)