Skip to content

Commit cc9e13c

Browse files
ChrisHegartyNikola Grcevski
and
Nikola Grcevski
authored
Upgrade XContent to Jackson 2.14.0 and enable Fast Double Parser (#90553)
Co-authored-by: Nikola Grcevski <[email protected]>
1 parent c55a9e7 commit cc9e13c

File tree

7 files changed

+36
-1
lines changed

7 files changed

+36
-1
lines changed

docs/changelog/90553.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 90553
2+
summary: Upgrade XContent to Jackson 2.14.0 and enable Fast Double Parser
3+
area: Infra/Core
4+
type: enhancement
5+
issues: []

gradle/verification-metadata.xml

+20
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@
244244
<sha256 value="ab119a8ea3cc69472ebc0e870b849bfbbe536ad57d613dc38453ccd592ca6a3d" origin="Generated by Gradle"/>
245245
</artifact>
246246
</component>
247+
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.14.0">
248+
<artifact name="jackson-core-2.14.0.jar">
249+
<sha256 value="ab4793e5df4fbfae445ca55e9e1439311c80fa8b34fc13162c1260902b4dbea0" origin="Generated by Gradle"/>
250+
</artifact>
251+
</component>
247252
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.10.5.1">
248253
<artifact name="jackson-databind-2.10.5.1.jar">
249254
<sha256 value="f93db83891a53e8d268e2cc8fcd88ead2981edc2163e35c2a52c88d9ab57b4a0" origin="Generated by Gradle"/>
@@ -279,11 +284,21 @@
279284
<sha256 value="8a6a687759739421b1f3c3f9678e7bc1cb37df5832e365996e2f412d7ca7e860" origin="Generated by Gradle"/>
280285
</artifact>
281286
</component>
287+
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-cbor" version="2.14.0">
288+
<artifact name="jackson-dataformat-cbor-2.14.0.jar">
289+
<sha256 value="f93c35d8b48ebc8bfe96a9d9e6d7e473f4744eb74819213e1d3af6ba40c940d2" origin="Generated by Gradle"/>
290+
</artifact>
291+
</component>
282292
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-smile" version="2.13.2">
283293
<artifact name="jackson-dataformat-smile-2.13.2.jar">
284294
<sha256 value="cc492aaeeb5cdb899d175c8433846eeddf2a52e92aee79e94ce6a34f86f38f98" origin="Generated by Gradle"/>
285295
</artifact>
286296
</component>
297+
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-smile" version="2.14.0">
298+
<artifact name="jackson-dataformat-smile-2.14.0.jar">
299+
<sha256 value="5cc75dadecccbd4f74bd27304ee3fd5c642adcad0fd1df97dcc670c04e15b367" origin="Generated by Gradle"/>
300+
</artifact>
301+
</component>
287302
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-xml" version="2.13.2">
288303
<artifact name="jackson-dataformat-xml-2.13.2.jar">
289304
<sha256 value="8ea46758e5720695ab0fd9455d33ba698784a079248057a34148f2c23fe2f4b0" origin="Generated by Gradle"/>
@@ -294,6 +309,11 @@
294309
<sha256 value="e0a4d674e5aaf30ed3cd045e7fd94e9b82f0a7fbe94b25c8c496f70977966ba3" origin="Generated by Gradle"/>
295310
</artifact>
296311
</component>
312+
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-yaml" version="2.14.0">
313+
<artifact name="jackson-dataformat-yaml-2.14.0.jar">
314+
<sha256 value="76e8a33ef1f5f8cce9668ebaf8999626846ccacb36dea81bcdaf79e32443de33" origin="Generated by Gradle"/>
315+
</artifact>
316+
</component>
297317
<component group="com.fasterxml.jackson.datatype" name="jackson-datatype-jsr310" version="2.13.2">
298318
<artifact name="jackson-datatype-jsr310-2.13.2.jar">
299319
<sha256 value="cf5034791afbbec5139d539c1a94194f172d52a516ad9c25aad5f235a937c747" origin="Generated by Gradle"/>

libs/x-content/impl/build.gradle

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.java'
1010

1111
archivesBaseName = "x-content-impl"
1212

13-
String jacksonVersion = "2.13.2"
13+
String jacksonVersion = "2.14.0"
1414

1515
dependencies {
1616
compileOnly project(':libs:elasticsearch-core')
@@ -36,6 +36,12 @@ tasks.named("dependencyLicenses").configure {
3636
mapping from: /jackson-.*/, to: 'jackson'
3737
}
3838

39+
// workaround for (/com/fasterxml/jackson/core/JsonFactory.class): warning: Cannot find annotation method
40+
// 'value()' in type 'ServiceProvider': class file for aQute.bnd.annotation.spi.ServiceProvider not found
41+
tasks.withType(JavaCompile).configureEach {
42+
options.compilerArgs.add("-Xlint:-classfile")
43+
}
44+
3945
// not published, so no need for javadoc
4046
tasks.named("javadoc").configure { enabled = false }
4147

libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/cbor/CborXContentImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static XContent cborXContent() {
5050
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.dataformat.cbor.CBORGenerator#close() method
5151
cborFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
5252
cborFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
53+
cborFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
5354
cborXContent = new CborXContentImpl();
5455
}
5556

libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static final XContent jsonXContent() {
5151
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.core.json.UTF8JsonGenerator#close() method
5252
jsonFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
5353
jsonFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
54+
jsonFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
5455
jsonXContent = new JsonXContentImpl();
5556
}
5657

libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/smile/SmileXContentImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public static XContent smileXContent() {
5252
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.dataformat.smile.SmileGenerator#close() method
5353
smileFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
5454
smileFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
55+
smileFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
5556
smileXContent = new SmileXContentImpl();
5657
}
5758

libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/yaml/YamlXContentImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static XContent yamlXContent() {
4444
static {
4545
yamlFactory = new YAMLFactory();
4646
yamlFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
47+
yamlFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
4748
yamlXContent = new YamlXContentImpl();
4849
}
4950

0 commit comments

Comments
 (0)