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 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) 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) - } -}