Skip to content

Commit 28a93ff

Browse files
authored
Merge branch '2.x' into 2.20
2 parents 71d0999 + 2a57813 commit 28a93ff

File tree

19 files changed

+51
-333
lines changed

19 files changed

+51
-333
lines changed

.github/workflows/dep_build_v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
java_version: ['8', '17', '21', '24']
1818
# Versions need to align with ones in 'main.yml' workflow
19-
kotlin_version: ['2.0.21', '2.1.21', '2.2.20']
19+
kotlin_version: ['2.1.21', '2.2.20']
2020
env:
2121
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
2222
steps:

.github/workflows/dep_build_v3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
java_version: ['17', '21', '24']
1616
# Versions need to align with ones in 'main.yml' workflow
17-
kotlin_version: ['2.0.21', '2.1.21', '2.2.20']
17+
kotlin_version: ['2.1.21', '2.2.20']
1818
env:
1919
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
2020
steps:

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
max-parallel: 5
2222
matrix:
2323
java_version: ['8', '11', '17', '21', '24']
24-
kotlin_version: ['2.0.21', '2.1.21', '2.2.20']
24+
kotlin_version: ['2.1.21', '2.2.20']
2525
include:
2626
- java_version: '8'
27-
kotlin_version: '2.0.21'
27+
kotlin_version: '2.1.21'
2828
release_build: 'R'
2929
env:
3030
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ println(arrayNode.toString()) // ["foo",true,1,1.0,"YmFy"]
111111
Different `kotlin-core` versions are supported by different Jackson Kotlin module minor versions.
112112
Here is an incomplete list of supported versions:
113113

114+
* Jackson 2.21.x: Kotlin-core 2.1 - 2.2
114115
* Jackson 2.20.x: Kotlin-core 2.0 - 2.2
115116
* Jackson 2.19.x: Kotlin-core 1.9 - 2.1
116117
* Jackson 2.18.x: Kotlin-core 1.8 - 2.1
117-
* Jackson 2.17.x: Kotlin-core 1.7 - 2.0
118118

119119
Please note that the versions supported by 2.17 are tentative and may change depending on the release date.
120120

pom.xml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<parent>
99
<groupId>com.fasterxml.jackson</groupId>
1010
<artifactId>jackson-base</artifactId>
11-
<version>2.20.1-SNAPSHOT</version>
11+
<version>2.21.0-SNAPSHOT</version>
1212
</parent>
1313
<groupId>com.fasterxml.jackson.module</groupId>
1414
<artifactId>jackson-module-kotlin</artifactId>
1515
<name>jackson-module-kotlin</name>
16-
<version>2.20.1-SNAPSHOT</version>
16+
<version>2.21.0-SNAPSHOT</version>
1717
<packaging>bundle</packaging>
1818
<description>Add-on module for Jackson (https://github.com/FasterXML/jackson/) to support
1919
Kotlin language, specifically introspection of method/constructor parameter names,
@@ -62,7 +62,7 @@
6262
<javac.src.version>1.8</javac.src.version>
6363
<javac.target.version>1.8</javac.target.version>
6464

65-
<version.kotlin>2.0.21</version.kotlin>
65+
<version.kotlin>2.1.21</version.kotlin>
6666

6767
<!-- Generate PackageVersion.java into this directory. -->
6868
<packageVersion.dir>com/fasterxml/jackson/module/kotlin</packageVersion.dir>
@@ -237,7 +237,7 @@
237237
-->
238238
<!-- 30-Sep-2023, wrongwrong: For 2.16, compare to 2.15.2 baseline
239239
-->
240-
<version>2.19.0</version>
240+
<version>2.20.0</version>
241241
<type>jar</type>
242242
</dependency>
243243
</oldVersion>
@@ -253,24 +253,17 @@
253253
<!-- public -->
254254
<!-- removed -->
255255
<exclude>
256-
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException#MissingKotlinParameterException(kotlin.reflect.KParameter,java.io.Closeable,java.lang.String)
256+
com.fasterxml.jackson.module.kotlin.KotlinModule#getEnabledSingletonSupport()
257257
</exclude>
258-
<exclude>
259-
com.fasterxml.jackson.module.kotlin.WrapsNullableValueClassBoxDeserializer
260-
</exclude>
261-
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassUnboxKeySerializer</exclude>
262-
<exclude>com.fasterxml.jackson.module.kotlin.KotlinKeySerializersKt</exclude>
263-
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassSerializer</exclude>
258+
<exclude>com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException</exclude>
259+
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassUnboxSerializer</exclude>
264260
<!-- internal -->
265261
<exclude>
266-
com.fasterxml.jackson.module.kotlin.KotlinKeySerializers#KotlinKeySerializers()
262+
com.fasterxml.jackson.module.kotlin.KotlinInstantiators#KotlinInstantiators(com.fasterxml.jackson.module.kotlin.ReflectionCache,boolean,boolean,boolean,boolean)
267263
</exclude>
268264
<exclude>
269-
com.fasterxml.jackson.module.kotlin.KotlinSerializers#KotlinSerializers()
265+
com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator#KotlinValueInstantiator(com.fasterxml.jackson.databind.deser.std.StdValueInstantiator,com.fasterxml.jackson.module.kotlin.ReflectionCache,boolean,boolean,boolean,boolean)
270266
</exclude>
271-
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassStaticJsonKeySerializer</exclude>
272-
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassBoxConverter</exclude>
273-
<exclude>com.fasterxml.jackson.module.kotlin.ValueClassKeyDeserializer</exclude>
274267
</excludes>
275268
</parameter>
276269
</configuration>

release-notes/CREDITS-2.x

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ Authors:
1515

1616
Contributors:
1717

18-
# 2.20.0 (not yet released)
18+
# 2.21.0 (not yet released)
19+
20+
WrongWrong (@k163377)
21+
* #1043: Cleanup of deprecated contents
22+
* #1042: Remove old StrictNullChecks
23+
* #1041: Remove MissingKotlinParameterException
24+
* #1039: Update settings for 2.20
25+
26+
# 2.20.0 (28-Aug-2025)
1927

2028
WrongWrong (@k163377)
2129
* #1025: Deprecate MissingKotlinParameterException and replace with new exception

release-notes/VERSION-2.x

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Co-maintainers:
1616
=== Releases ===
1717
------------------------------------------------------------------------
1818

19+
2.21.0 (not yet released)
20+
21+
#1043: Deprecated content has been cleaned up with the version upgrade.
22+
#1042: The old StrictNullChecks backend has been removed.
23+
This improves the throughput of deserialization slightly.
24+
#1041: The deprecated MissingKotlinParameterException has been removed.
25+
#1039: Kotlin has been upgraded to 2.1.x.
26+
1927
2.20.0 (28-Aug-2025)
2028

2129
#1025: When a null is entered for a non-null parameter, the KotlinInvalidNullException is now thrown instead of the

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) {
4040
*
4141
* With this disabled, the default, collections which are typed to disallow null members (e.g. `List<String>`)
4242
* may contain null values after deserialization.
43-
* Enabling it protects against this but has significant performance impact.
43+
* Enabling this will cause an [InvalidNullException] to be thrown if null is entered.
44+
*
45+
* Internally, it will be the same as if [JsonSetter] (contentNulls = FAIL) had been granted.
46+
*
47+
* Benchmarks show that it can check for illegal nulls with throughput nearly identical to the default (see [jackson-module-kotlin#719]).
4448
*/
45-
@Deprecated(
46-
level = DeprecationLevel.ERROR,
47-
message = "This option will be migrated to the new backend in 2.21.",
48-
replaceWith = ReplaceWith("NewStrictNullChecks")
49-
)
5049
StrictNullChecks(enabledByDefault = false),
5150

5251
/**
@@ -80,15 +79,15 @@ enum class KotlinFeature(internal val enabledByDefault: Boolean) {
8079
* Internally, it will be the same as if [JsonSetter] (contentNulls = FAIL) had been granted.
8180
* Benchmarks show that it can check for illegal nulls with throughput nearly identical to the default (see [jackson-module-kotlin#719]).
8281
*
83-
* Note that in the new backend, the exception thrown has changed from [MissingKotlinParameterException] to [InvalidNullException].
84-
* The message will be changed accordingly.
85-
* Since 2.19, the base class of [MissingKotlinParameterException] has also been changed to [InvalidNullException],
86-
* so be careful when catching it.
87-
*
8882
* This is a temporary option for a phased backend migration,
8983
* which will eventually be merged into [StrictNullChecks].
9084
* Also, specifying both this and [StrictNullChecks] is not permitted.
9185
*/
86+
@Deprecated(
87+
level = DeprecationLevel.WARNING,
88+
message = "This option will be merged into StrictNullChecks in 2.23.",
89+
replaceWith = ReplaceWith("StrictNullChecks")
90+
)
9291
NewStrictNullChecks(enabledByDefault = false);
9392

9493
internal val bitSet: BitSet = (1 shl ordinal).toBitSet()

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

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,11 @@ class KotlinModule private constructor(
4343
val nullToEmptyMap: Boolean = NullToEmptyMap.enabledByDefault,
4444
val nullIsSameAsDefault: Boolean = NullIsSameAsDefault.enabledByDefault,
4545
val singletonSupport: Boolean = SingletonSupport.enabledByDefault,
46-
@Suppress("DEPRECATION_ERROR")
4746
strictNullChecks: Boolean = StrictNullChecks.enabledByDefault,
4847
val kotlinPropertyNameAsImplicitName: Boolean = KotlinPropertyNameAsImplicitName.enabledByDefault,
4948
val useJavaDurationConversion: Boolean = UseJavaDurationConversion.enabledByDefault,
50-
private val newStrictNullChecks: Boolean = NewStrictNullChecks.enabledByDefault,
49+
newStrictNullChecks: Boolean = NewStrictNullChecks.enabledByDefault,
5150
) : SimpleModule(KotlinModule::class.java.name, PackageVersion.VERSION) {
52-
/*
53-
* Prior to 2.18, an older Enum called SingletonSupport was used to manage feature.
54-
* To deprecate it and replace it with singletonSupport: Boolean, the following steps are in progress.
55-
*
56-
* 1. add enabledSingletonSupport: Boolean property
57-
* 2. delete SingletonSupport class and change the property to singletonSupport: Boolean
58-
* 3. remove the enabledSingletonSupport property
59-
*
60-
* Now that 2 is complete, deprecation is in progress for 3.
61-
*/
62-
@Deprecated(
63-
level = DeprecationLevel.ERROR,
64-
message = "This property is scheduled to be removed in 2.21 or later" +
65-
" in order to unify the use of KotlinFeature.",
66-
replaceWith = ReplaceWith("singletonSupport")
67-
)
68-
val enabledSingletonSupport: Boolean get() = singletonSupport
69-
70-
private val oldStrictNullChecks: Boolean = strictNullChecks
71-
7251
// To reduce the amount of destructive changes, no properties will be added to the public.
7352
val strictNullChecks: Boolean = if (strictNullChecks) {
7453
if (newStrictNullChecks) {
@@ -113,7 +92,7 @@ class KotlinModule private constructor(
11392

11493
val cache = ReflectionCache(reflectionCacheSize)
11594

116-
context.addValueInstantiators(KotlinInstantiators(cache, nullToEmptyCollection, nullToEmptyMap, nullIsSameAsDefault, oldStrictNullChecks))
95+
context.addValueInstantiators(KotlinInstantiators(cache, nullToEmptyCollection, nullToEmptyMap, nullIsSameAsDefault))
11796

11897
if (singletonSupport) {
11998
context.addBeanDeserializerModifier(KotlinBeanDeserializerModifier)
@@ -128,7 +107,7 @@ class KotlinModule private constructor(
128107
useJavaDurationConversion
129108
))
130109
context.appendAnnotationIntrospector(
131-
KotlinNamesAnnotationIntrospector(cache, newStrictNullChecks, kotlinPropertyNameAsImplicitName)
110+
KotlinNamesAnnotationIntrospector(cache, strictNullChecks, kotlinPropertyNameAsImplicitName)
132111
)
133112

134113
context.addDeserializers(KotlinDeserializers(cache, useJavaDurationConversion))

0 commit comments

Comments
 (0)