From 2ab7353a91d35d5e89fa69b16fe37a5c4dc0b296 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Mon, 28 Apr 2025 14:55:10 +0900 Subject: [PATCH 1/3] Raise deprecation level --- .../com/fasterxml/jackson/module/kotlin/KotlinFeature.kt | 2 +- .../com/fasterxml/jackson/module/kotlin/KotlinModule.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt index e7e12d5ba..1e9a62a99 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt @@ -43,7 +43,7 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) { * Enabling it protects against this but has significant performance impact. */ @Deprecated( - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, message = "This option will be migrated to the new backend in 2.21.", replaceWith = ReplaceWith("NewStrictNullChecks") ) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt index f09b1707a..d14e0293d 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt @@ -43,6 +43,7 @@ class KotlinModule private constructor( val nullToEmptyMap: Boolean = NullToEmptyMap.enabledByDefault, val nullIsSameAsDefault: Boolean = NullIsSameAsDefault.enabledByDefault, val singletonSupport: Boolean = SingletonSupport.enabledByDefault, + @Suppress("DEPRECATION_ERROR") strictNullChecks: Boolean = StrictNullChecks.enabledByDefault, val kotlinPropertyNameAsImplicitName: Boolean = KotlinPropertyNameAsImplicitName.enabledByDefault, val useJavaDurationConversion: Boolean = UseJavaDurationConversion.enabledByDefault, @@ -59,7 +60,7 @@ class KotlinModule private constructor( * Now that 2 is complete, deprecation is in progress for 3. */ @Deprecated( - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, message = "This property is scheduled to be removed in 2.21 or later" + " in order to unify the use of KotlinFeature.", replaceWith = ReplaceWith("singletonSupport") @@ -96,6 +97,7 @@ class KotlinModule private constructor( builder.isEnabled(NullToEmptyMap), builder.isEnabled(NullIsSameAsDefault), builder.isEnabled(SingletonSupport), + @Suppress("DEPRECATION_ERROR") builder.isEnabled(StrictNullChecks), builder.isEnabled(KotlinPropertyNameAsImplicitName), builder.isEnabled(UseJavaDurationConversion), From 7e2717501e9a0619af20a8b7dd3f130cabb1893b Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Mon, 28 Apr 2025 15:05:18 +0900 Subject: [PATCH 2/3] Remove deprecated old constructor --- pom.xml | 5 +++++ .../fasterxml/jackson/module/kotlin/Exceptions.kt | 14 +------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 53644d4b9..59a36c2d1 100644 --- a/pom.xml +++ b/pom.xml @@ -245,6 +245,11 @@ true true + + + + com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException#MissingKotlinParameterException(kotlin.reflect.KParameter,java.io.Closeable,java.lang.String) + diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt index 120ad0f08..3e9981c6c 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Exceptions.kt @@ -3,7 +3,6 @@ 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 java.io.Closeable import kotlin.reflect.KParameter /** @@ -31,15 +30,4 @@ class MissingKotlinParameterException( val parameter: KParameter, processor: JsonParser? = null, msg: String -) : InvalidNullException(processor, msg, null) { - @Deprecated( - "Use main constructor, ", - ReplaceWith("MissingKotlinParameterException(KParameter, JsonParser?, String)"), - DeprecationLevel.ERROR, - ) - constructor( - parameter: KParameter, - processor: Closeable? = null, - msg: String - ) : this(parameter, processor as JsonParser, msg) -} +) : InvalidNullException(processor, msg, null) From b0afcc0e29343df8b9b9c20f40a0c4bed7de9173 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Mon, 28 Apr 2025 15:11:50 +0900 Subject: [PATCH 3/3] Update release notes wrt #969 --- 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 6a7d5934c..231186cdb 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -18,6 +18,7 @@ Contributors: # 2.20.0 (not yet released) WrongWrong (@k163377) +* #969: Cleanup of deprecated contents * #967: Update settings for 2.20 # 2.19.1 (not yet released) diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 78231626a..c23ff038d 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -18,6 +18,7 @@ Co-maintainers: 2.20.0 (not yet released) +#969: Deprecated content has been cleaned up with the version upgrade. #967: Kotlin has been upgraded to 2.0.21. 2.19.1 (not yet released)