From 2a2be7476b8d0f7779512f557b5f42308d21082b Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sat, 30 Aug 2025 15:01:01 +0900 Subject: [PATCH 1/3] Remove MissingKotlinParameterException --- .../jackson/module/kotlin/Exceptions.kt | 29 ------------------- .../MissingKotlinParameterExceptionTest.kt | 21 -------------- 2 files changed, 50 deletions(-) delete mode 100644 src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt delete mode 100644 src/test/kotlin/com/fasterxml/jackson/module/kotlin/MissingKotlinParameterExceptionTest.kt diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt deleted file mode 100644 index cbea3960..00000000 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.fasterxml.jackson.module.kotlin - -import com.fasterxml.jackson.core.JsonParser -import com.fasterxml.jackson.databind.JsonMappingException -import com.fasterxml.jackson.databind.exc.InvalidNullException -import kotlin.reflect.KParameter - -/** - * Specialized [JsonMappingException] sub-class used to indicate that a mandatory Kotlin constructor - * parameter was missing or null. - */ -@Deprecated( - "Since 2.20, this exception is no longer thrown and has been replaced by KotlinInvalidNullException. " + - "See #617 for details.", - ReplaceWith("KotlinInvalidNullException"), - DeprecationLevel.ERROR -) -// When deserialized by the JDK, the parameter property will be null, ignoring nullability. -// This is a temporary workaround for #572 and we will eventually remove this class. -class MissingKotlinParameterException( - @property:Deprecated( - "KParameter is not serializable and will be removed in 2.20 or later. See #572 for details.", - level = DeprecationLevel.WARNING - ) - @Transient - val parameter: KParameter, - processor: JsonParser? = null, - msg: String -) : InvalidNullException(processor, msg, null) diff --git a/src/test/kotlin/com/fasterxml/jackson/module/kotlin/MissingKotlinParameterExceptionTest.kt b/src/test/kotlin/com/fasterxml/jackson/module/kotlin/MissingKotlinParameterExceptionTest.kt deleted file mode 100644 index af3eacfc..00000000 --- a/src/test/kotlin/com/fasterxml/jackson/module/kotlin/MissingKotlinParameterExceptionTest.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.fasterxml.jackson.module.kotlin - -import org.junit.jupiter.api.Test -import kotlin.test.assertNotNull -import kotlin.test.assertNull - -class MissingKotlinParameterExceptionTest { - @Suppress("DEPRECATION_ERROR") - @Test - fun jdkSerializabilityTest() { - val param = ::MissingKotlinParameterException.parameters.first() - val ex = MissingKotlinParameterException(param, null, "test") - - val serialized = jdkSerialize(ex) - val deserialized = jdkDeserialize(serialized) - - assertNotNull(deserialized) - // see comment at MissingKotlinParameterException - assertNull(deserialized.parameter) - } -} From f120a67603ac4f536d5386dbeb889c87fe0e2c9c Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sat, 30 Aug 2025 15:56:22 +0900 Subject: [PATCH 2/3] Update cmp config --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 28c15884..7001baf4 100644 --- a/pom.xml +++ b/pom.xml @@ -252,6 +252,7 @@ + com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException From c464c252519e7b6d8adb48d760f67ce67ce1f307 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sat, 30 Aug 2025 15:59:14 +0900 Subject: [PATCH 3/3] Update release notes wrt #1041 --- release-notes/CREDITS-2.x | 1 + release-notes/VERSION-2.x | 1 + 2 files changed, 2 insertions(+) diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index 6ca59364..18e27f04 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -18,6 +18,7 @@ Contributors: # 2.21.0 (not yet released) WrongWrong (@k163377) +* #1041: Remove MissingKotlinParameterException * #1039: Update settings for 2.20 # 2.20.0 (28-Aug-2025) diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index ee3718fe..eaa01fe7 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -18,6 +18,7 @@ Co-maintainers: 2.21.0 (not yet released) +#1041: The deprecated MissingKotlinParameterException has been removed. #1039: Kotlin has been upgraded to 2.1.x. 2.20.0 (28-Aug-2025)