Skip to content

Commit ff01676

Browse files
committed
Raise DeprecationLevel for contents that has already been deprecated
1 parent 1a997dd commit ff01676

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt

+10-9
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyMap
88
import com.fasterxml.jackson.module.kotlin.KotlinFeature.StrictNullChecks
99
import com.fasterxml.jackson.module.kotlin.KotlinFeature.KotlinPropertyNameAsImplicitName
1010
import com.fasterxml.jackson.module.kotlin.KotlinFeature.UseJavaDurationConversion
11-
import com.fasterxml.jackson.module.kotlin.SingletonSupport.CANONICALIZE
12-
import com.fasterxml.jackson.module.kotlin.SingletonSupport.DISABLED
1311
import java.util.*
1412
import kotlin.reflect.KClass
1513

@@ -44,23 +42,26 @@ class KotlinModule private constructor(
4442
val nullToEmptyMap: Boolean = NullToEmptyMap.enabledByDefault,
4543
val nullIsSameAsDefault: Boolean = NullIsSameAsDefault.enabledByDefault,
4644
@property:Deprecated(
47-
level = DeprecationLevel.WARNING,
45+
level = DeprecationLevel.ERROR,
4846
message = "The return value will be Boolean in 2.19. Until then, use enabledSingletonSupport.",
4947
replaceWith = ReplaceWith("enabledSingletonSupport")
5048
)
51-
val singletonSupport: SingletonSupport = DISABLED,
49+
@Suppress("DEPRECATION_ERROR")
50+
val singletonSupport: SingletonSupport = SingletonSupport.DISABLED,
5251
val strictNullChecks: Boolean = StrictNullChecks.enabledByDefault,
5352
@Deprecated(
54-
level = DeprecationLevel.WARNING,
53+
level = DeprecationLevel.ERROR,
5554
message = "There was a discrepancy between the property name and the Feature name." +
5655
" To migrate to the correct property name, it will be ERROR in 2.18 and removed in 2.19.",
5756
replaceWith = ReplaceWith("kotlinPropertyNameAsImplicitName")
5857
)
5958
val useKotlinPropertyNameForGetter: Boolean = KotlinPropertyNameAsImplicitName.enabledByDefault,
6059
val useJavaDurationConversion: Boolean = UseJavaDurationConversion.enabledByDefault,
6160
) : SimpleModule(KotlinModule::class.java.name, PackageVersion.VERSION) {
61+
@Suppress("DEPRECATION_ERROR")
6262
val kotlinPropertyNameAsImplicitName: Boolean get() = useKotlinPropertyNameForGetter
63-
val enabledSingletonSupport: Boolean get() = singletonSupport == CANONICALIZE
63+
@Suppress("DEPRECATION_ERROR")
64+
val enabledSingletonSupport: Boolean get() = singletonSupport == SingletonSupport.CANONICALIZE
6465

6566
companion object {
6667
// Increment when option is added
@@ -73,15 +74,15 @@ class KotlinModule private constructor(
7374
)
7475
constructor() : this()
7576

76-
@Suppress("DEPRECATION_ERROR")
7777
private constructor(builder: Builder) : this(
7878
builder.reflectionCacheSize,
7979
builder.isEnabled(NullToEmptyCollection),
8080
builder.isEnabled(NullToEmptyMap),
8181
builder.isEnabled(NullIsSameAsDefault),
82+
@Suppress("DEPRECATION_ERROR")
8283
when {
83-
builder.isEnabled(KotlinFeature.SingletonSupport) -> CANONICALIZE
84-
else -> DISABLED
84+
builder.isEnabled(KotlinFeature.SingletonSupport) -> SingletonSupport.CANONICALIZE
85+
else -> SingletonSupport.DISABLED
8586
},
8687
builder.isEnabled(StrictNullChecks),
8788
builder.isEnabled(KotlinPropertyNameAsImplicitName),

src/main/kotlin/com/fasterxml/jackson/module/kotlin/SingletonSupport.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package com.fasterxml.jackson.module.kotlin
44
* Special handling for singletons.
55
*/
66
@Deprecated(
7-
level = DeprecationLevel.WARNING,
7+
level = DeprecationLevel.ERROR,
88
message = "It will be removed in 2.19 to unify with KotlinFeature.",
99
replaceWith = ReplaceWith("KotlinFeature.SingletonSupport")
1010
)

0 commit comments

Comments
 (0)