@@ -8,8 +8,6 @@ import com.fasterxml.jackson.module.kotlin.KotlinFeature.NullToEmptyMap
8
8
import com.fasterxml.jackson.module.kotlin.KotlinFeature.StrictNullChecks
9
9
import com.fasterxml.jackson.module.kotlin.KotlinFeature.KotlinPropertyNameAsImplicitName
10
10
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
13
11
import java.util.*
14
12
import kotlin.reflect.KClass
15
13
@@ -44,23 +42,26 @@ class KotlinModule private constructor(
44
42
val nullToEmptyMap : Boolean = NullToEmptyMap .enabledByDefault,
45
43
val nullIsSameAsDefault : Boolean = NullIsSameAsDefault .enabledByDefault,
46
44
@property:Deprecated(
47
- level = DeprecationLevel .WARNING ,
45
+ level = DeprecationLevel .ERROR ,
48
46
message = "The return value will be Boolean in 2.19. Until then, use enabledSingletonSupport.",
49
47
replaceWith = ReplaceWith ("enabledSingletonSupport")
50
48
)
51
- val singletonSupport : SingletonSupport = DISABLED ,
49
+ @Suppress(" DEPRECATION_ERROR" )
50
+ val singletonSupport : SingletonSupport = SingletonSupport .DISABLED ,
52
51
val strictNullChecks : Boolean = StrictNullChecks .enabledByDefault,
53
52
@Deprecated(
54
- level = DeprecationLevel .WARNING ,
53
+ level = DeprecationLevel .ERROR ,
55
54
message = " There was a discrepancy between the property name and the Feature name." +
56
55
" To migrate to the correct property name, it will be ERROR in 2.18 and removed in 2.19." ,
57
56
replaceWith = ReplaceWith (" kotlinPropertyNameAsImplicitName" )
58
57
)
59
58
val useKotlinPropertyNameForGetter : Boolean = KotlinPropertyNameAsImplicitName .enabledByDefault,
60
59
val useJavaDurationConversion : Boolean = UseJavaDurationConversion .enabledByDefault,
61
60
) : SimpleModule(KotlinModule : :class.java.name, PackageVersion .VERSION ) {
61
+ @Suppress(" DEPRECATION_ERROR" )
62
62
val kotlinPropertyNameAsImplicitName: Boolean get() = useKotlinPropertyNameForGetter
63
- val enabledSingletonSupport: Boolean get() = singletonSupport == CANONICALIZE
63
+ @Suppress(" DEPRECATION_ERROR" )
64
+ val enabledSingletonSupport: Boolean get() = singletonSupport == SingletonSupport .CANONICALIZE
64
65
65
66
companion object {
66
67
// Increment when option is added
@@ -73,15 +74,15 @@ class KotlinModule private constructor(
73
74
)
74
75
constructor () : this ()
75
76
76
- @Suppress(" DEPRECATION_ERROR" )
77
77
private constructor (builder: Builder ) : this (
78
78
builder.reflectionCacheSize,
79
79
builder.isEnabled(NullToEmptyCollection ),
80
80
builder.isEnabled(NullToEmptyMap ),
81
81
builder.isEnabled(NullIsSameAsDefault ),
82
+ @Suppress(" DEPRECATION_ERROR" )
82
83
when {
83
- builder.isEnabled(KotlinFeature .SingletonSupport ) -> CANONICALIZE
84
- else -> DISABLED
84
+ builder.isEnabled(KotlinFeature .SingletonSupport ) -> SingletonSupport . CANONICALIZE
85
+ else -> SingletonSupport . DISABLED
85
86
},
86
87
builder.isEnabled(StrictNullChecks ),
87
88
builder.isEnabled(KotlinPropertyNameAsImplicitName ),
0 commit comments