Skip to content

Commit

Permalink
Upgrade XContent to Jackson 2.14.0 and enable Fast Double Parser (#90553
Browse files Browse the repository at this point in the history
)

Co-authored-by: Nikola Grcevski <nikola.grcevski@elastic.co>
  • Loading branch information
ChrisHegarty and Nikola Grcevski authored Nov 7, 2022
1 parent c55a9e7 commit cc9e13c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog/90553.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 90553
summary: Upgrade XContent to Jackson 2.14.0 and enable Fast Double Parser
area: Infra/Core
type: enhancement
issues: []
20 changes: 20 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@
<sha256 value="ab119a8ea3cc69472ebc0e870b849bfbbe536ad57d613dc38453ccd592ca6a3d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.14.0">
<artifact name="jackson-core-2.14.0.jar">
<sha256 value="ab4793e5df4fbfae445ca55e9e1439311c80fa8b34fc13162c1260902b4dbea0" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.10.5.1">
<artifact name="jackson-databind-2.10.5.1.jar">
<sha256 value="f93db83891a53e8d268e2cc8fcd88ead2981edc2163e35c2a52c88d9ab57b4a0" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -279,11 +284,21 @@
<sha256 value="8a6a687759739421b1f3c3f9678e7bc1cb37df5832e365996e2f412d7ca7e860" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-cbor" version="2.14.0">
<artifact name="jackson-dataformat-cbor-2.14.0.jar">
<sha256 value="f93c35d8b48ebc8bfe96a9d9e6d7e473f4744eb74819213e1d3af6ba40c940d2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-smile" version="2.13.2">
<artifact name="jackson-dataformat-smile-2.13.2.jar">
<sha256 value="cc492aaeeb5cdb899d175c8433846eeddf2a52e92aee79e94ce6a34f86f38f98" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-smile" version="2.14.0">
<artifact name="jackson-dataformat-smile-2.14.0.jar">
<sha256 value="5cc75dadecccbd4f74bd27304ee3fd5c642adcad0fd1df97dcc670c04e15b367" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-xml" version="2.13.2">
<artifact name="jackson-dataformat-xml-2.13.2.jar">
<sha256 value="8ea46758e5720695ab0fd9455d33ba698784a079248057a34148f2c23fe2f4b0" origin="Generated by Gradle"/>
Expand All @@ -294,6 +309,11 @@
<sha256 value="e0a4d674e5aaf30ed3cd045e7fd94e9b82f0a7fbe94b25c8c496f70977966ba3" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.dataformat" name="jackson-dataformat-yaml" version="2.14.0">
<artifact name="jackson-dataformat-yaml-2.14.0.jar">
<sha256 value="76e8a33ef1f5f8cce9668ebaf8999626846ccacb36dea81bcdaf79e32443de33" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.datatype" name="jackson-datatype-jsr310" version="2.13.2">
<artifact name="jackson-datatype-jsr310-2.13.2.jar">
<sha256 value="cf5034791afbbec5139d539c1a94194f172d52a516ad9c25aad5f235a937c747" origin="Generated by Gradle"/>
Expand Down
8 changes: 7 additions & 1 deletion libs/x-content/impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.java'

archivesBaseName = "x-content-impl"

String jacksonVersion = "2.13.2"
String jacksonVersion = "2.14.0"

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

// workaround for (/com/fasterxml/jackson/core/JsonFactory.class): warning: Cannot find annotation method
// 'value()' in type 'ServiceProvider': class file for aQute.bnd.annotation.spi.ServiceProvider not found
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.add("-Xlint:-classfile")
}

// not published, so no need for javadoc
tasks.named("javadoc").configure { enabled = false }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static XContent cborXContent() {
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.dataformat.cbor.CBORGenerator#close() method
cborFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
cborFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
cborFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
cborXContent = new CborXContentImpl();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static final XContent jsonXContent() {
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.core.json.UTF8JsonGenerator#close() method
jsonFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
jsonFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
jsonFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
jsonXContent = new JsonXContentImpl();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static XContent smileXContent() {
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.dataformat.smile.SmileGenerator#close() method
smileFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
smileFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
smileFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
smileXContent = new SmileXContentImpl();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static XContent yamlXContent() {
static {
yamlFactory = new YAMLFactory();
yamlFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
yamlFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
yamlXContent = new YamlXContentImpl();
}

Expand Down

0 comments on commit cc9e13c

Please sign in to comment.