Skip to content

Commit b8a9fcf

Browse files
authored
Merge pull request #760 from commercetools/SUPPORT-29621-jackson-2-18-fix
[SUPPORT-29621] fix regression with jackson 2.18.x
2 parents b98089c + e7f2827 commit b8a9fcf

File tree

22 files changed

+100
-79
lines changed

22 files changed

+100
-79
lines changed

build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ subprojects { project ->
116116
languageVersion = JavaLanguageVersion.of(17)
117117
}
118118
}
119+
compileIntegrationTestJava {
120+
javaCompiler = javaToolchains.compilerFor {
121+
languageVersion = JavaLanguageVersion.of(17)
122+
}
123+
}
119124
compileTestJava {
120125
javaCompiler = javaToolchains.compilerFor {
121126
languageVersion = JavaLanguageVersion.of(17)

commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/common/LocalizedStringImpl.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.time.*;
55
import java.util.*;
66

7+
import com.fasterxml.jackson.annotation.JsonAnySetter;
78
import com.fasterxml.jackson.annotation.JsonCreator;
89
import com.fasterxml.jackson.annotation.JsonProperty;
910
import com.fasterxml.jackson.databind.annotation.*;
@@ -23,7 +24,7 @@ public class LocalizedStringImpl implements LocalizedString, ModelBase {
2324
private Map<String, String> values;
2425

2526
@JsonCreator
26-
LocalizedStringImpl(@JsonProperty("values") final Map<String, String> values) {
27+
LocalizedStringImpl(@JsonAnySetter @JsonProperty("values") final Map<String, String> values) {
2728
this.values = values;
2829
}
2930

commercetools/commercetools-sdk-java-api/src/test/java/com/commercetools/LocalizedStringTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
package com.commercetools;
33

4+
import static com.commercetools.TestUtils.stringFromResource;
45
import static java.lang.String.format;
56
import static java.util.Arrays.asList;
67
import static java.util.Collections.singletonList;
@@ -12,6 +13,7 @@
1213

1314
import com.commercetools.api.models.common.LocalizedString;
1415
import com.commercetools.api.models.common.LocalizedStringEntry;
16+
import com.commercetools.api.models.product.ProductData;
1517

1618
import io.vrap.rmf.base.client.utils.json.JsonUtils;
1719

@@ -370,4 +372,12 @@ public void ofStringToStringMap() {
370372
.plus(Locale.ITALIAN, "Giacche");
371373
assertThat(actual).isEqualTo(expected);
372374
}
375+
376+
public static final String DEFAULT_LOCALE = "en-US";
377+
378+
@Test
379+
public void getLocale() {
380+
ProductData p = JsonUtils.fromJsonString(stringFromResource("product-data.json"), ProductData.class);
381+
assertThat(p.getName().get(DEFAULT_LOCALE)).isEqualTo("Hoodie");
382+
}
373383
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": {
3+
"en-US": "Hoodie"
4+
}
5+
}

gradle-scripts/extensions.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ ext {
3131
]
3232

3333
jackson_core = [
34-
annotations: 'com.fasterxml.jackson.core:jackson-annotations:2.17.1',
35-
databind: 'com.fasterxml.jackson.core:jackson-databind:2.17.1',
36-
core: 'com.fasterxml.jackson.core:jackson-core:2.17.1',
37-
datatype: 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1',
34+
annotations: 'com.fasterxml.jackson.core:jackson-annotations:2.18.1',
35+
databind: 'com.fasterxml.jackson.core:jackson-databind:2.18.1',
36+
core: 'com.fasterxml.jackson.core:jackson-core:2.18.1',
37+
datatype: 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1',
3838
]
3939

4040
google = [

licenses/commercetools-apachehttp-client/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

licenses/commercetools-async-http-client/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

licenses/commercetools-graphql-api/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

licenses/commercetools-http-client/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

licenses/commercetools-javanet-client/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

licenses/commercetools-monitoring-datadog/index.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
{
3434
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
35-
"moduleVersion": "2.17.1",
35+
"moduleVersion": "2.18.1",
3636
"moduleUrls": [
3737
"https://github.com/FasterXML/jackson"
3838
],
@@ -45,7 +45,7 @@
4545
},
4646
{
4747
"moduleName": "com.fasterxml.jackson.core:jackson-core",
48-
"moduleVersion": "2.17.1",
48+
"moduleVersion": "2.18.1",
4949
"moduleUrls": [
5050
"https://github.com/FasterXML/jackson-core"
5151
],
@@ -58,7 +58,7 @@
5858
},
5959
{
6060
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
61-
"moduleVersion": "2.17.1",
61+
"moduleVersion": "2.18.1",
6262
"moduleUrls": [
6363
"https://github.com/FasterXML/jackson"
6464
],
@@ -71,7 +71,7 @@
7171
},
7272
{
7373
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
74-
"moduleVersion": "2.17.1",
74+
"moduleVersion": "2.18.1",
7575
"moduleUrls": [
7676
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
7777
],
@@ -84,7 +84,7 @@
8484
},
8585
{
8686
"moduleName": "com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations",
87-
"moduleVersion": "2.17.1",
87+
"moduleVersion": "2.18.1",
8888
"moduleUrls": [
8989
"https://github.com/FasterXML/jackson-modules-base"
9090
],

licenses/commercetools-monitoring-newrelic/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

licenses/commercetools-monitoring-opentelemetry/index.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": [
33
{
44
"moduleName": "com.fasterxml.jackson.core:jackson-annotations",
5-
"moduleVersion": "2.17.1",
5+
"moduleVersion": "2.18.1",
66
"moduleUrls": [
77
"https://github.com/FasterXML/jackson"
88
],
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"moduleName": "com.fasterxml.jackson.core:jackson-core",
18-
"moduleVersion": "2.17.1",
18+
"moduleVersion": "2.18.1",
1919
"moduleUrls": [
2020
"https://github.com/FasterXML/jackson-core"
2121
],
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
"moduleName": "com.fasterxml.jackson.core:jackson-databind",
31-
"moduleVersion": "2.17.1",
31+
"moduleVersion": "2.18.1",
3232
"moduleUrls": [
3333
"https://github.com/FasterXML/jackson"
3434
],
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"moduleName": "com.fasterxml.jackson.datatype:jackson-datatype-jsr310",
44-
"moduleVersion": "2.17.1",
44+
"moduleVersion": "2.18.1",
4545
"moduleUrls": [
4646
"https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310"
4747
],

0 commit comments

Comments
 (0)