From 67c192bcb73ddb8661dd069f324457d313824c5e Mon Sep 17 00:00:00 2001 From: ChrisHegarty Date: Fri, 16 Sep 2022 09:59:28 +0100 Subject: [PATCH 1/5] Upgrade to Jackson 2.14.0-rc and enable Fast Double Parser --- gradle/verification-metadata.xml | 20 +++++++++++++++++++ libs/x-content/impl/build.gradle | 8 +++++++- .../provider/cbor/CborXContentImpl.java | 1 + .../provider/json/JsonXContentImpl.java | 1 + .../provider/smile/SmileXContentImpl.java | 1 + .../provider/yaml/YamlXContentImpl.java | 1 + 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index e9139dc0c25da..ebcf0488e21fc 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -244,6 +244,11 @@ + + + + + @@ -279,11 +284,21 @@ + + + + + + + + + + @@ -294,6 +309,11 @@ + + + + + diff --git a/libs/x-content/impl/build.gradle b/libs/x-content/impl/build.gradle index f7a7c6a173ee7..57e648884fbcb 100644 --- a/libs/x-content/impl/build.gradle +++ b/libs/x-content/impl/build.gradle @@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.java' archivesBaseName = "x-content-impl" -String jacksonVersion = "2.13.2" +String jacksonVersion = "2.14.0-rc1" dependencies { compileOnly project(':libs:elasticsearch-core') @@ -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 } diff --git a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/cbor/CborXContentImpl.java b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/cbor/CborXContentImpl.java index 7b06c0b4edaa7..1b2a6d02822ba 100644 --- a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/cbor/CborXContentImpl.java +++ b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/cbor/CborXContentImpl.java @@ -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(); } diff --git a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentImpl.java b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentImpl.java index c1fa4d9a39ce8..85890c87a3be0 100644 --- a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentImpl.java +++ b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentImpl.java @@ -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(); } diff --git a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/smile/SmileXContentImpl.java b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/smile/SmileXContentImpl.java index 31fb9d40066e6..46f8aeec20f29 100644 --- a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/smile/SmileXContentImpl.java +++ b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/smile/SmileXContentImpl.java @@ -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(); } diff --git a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/yaml/YamlXContentImpl.java b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/yaml/YamlXContentImpl.java index 232980c1e47c3..2d59b9588ab38 100644 --- a/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/yaml/YamlXContentImpl.java +++ b/libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/yaml/YamlXContentImpl.java @@ -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(); } From ebd50777f8c23b504d40e65b24a432919500a734 Mon Sep 17 00:00:00 2001 From: ChrisHegarty Date: Wed, 12 Oct 2022 11:13:20 +0100 Subject: [PATCH 2/5] Upgrade to Jackson rc2 --- gradle/verification-metadata.xml | 24 ++++++++++++------------ libs/x-content/impl/build.gradle | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 64b1b858b92ca..e110f9de98c2c 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -244,9 +244,9 @@ - - - + + + @@ -284,9 +284,9 @@ - - - + + + @@ -294,9 +294,9 @@ - - - + + + @@ -309,9 +309,9 @@ - - - + + + diff --git a/libs/x-content/impl/build.gradle b/libs/x-content/impl/build.gradle index 57e648884fbcb..36d6ed5e3d9a6 100644 --- a/libs/x-content/impl/build.gradle +++ b/libs/x-content/impl/build.gradle @@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.java' archivesBaseName = "x-content-impl" -String jacksonVersion = "2.14.0-rc1" +String jacksonVersion = "2.14.0-rc2" dependencies { compileOnly project(':libs:elasticsearch-core') From b7876a252b902ce38e438a54db047d68ea8fef5a Mon Sep 17 00:00:00 2001 From: ChrisHegarty Date: Wed, 2 Nov 2022 17:19:50 +0000 Subject: [PATCH 3/5] Upgrade to Jackson rc3 --- gradle/verification-metadata.xml | 24 ++++++++++++------------ libs/x-content/impl/build.gradle | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 283216916d917..f6bb85c16f1d1 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -244,9 +244,9 @@ - - - + + + @@ -284,9 +284,9 @@ - - - + + + @@ -294,9 +294,9 @@ - - - + + + @@ -309,9 +309,9 @@ - - - + + + diff --git a/libs/x-content/impl/build.gradle b/libs/x-content/impl/build.gradle index 36d6ed5e3d9a6..3525c2e319162 100644 --- a/libs/x-content/impl/build.gradle +++ b/libs/x-content/impl/build.gradle @@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.java' archivesBaseName = "x-content-impl" -String jacksonVersion = "2.14.0-rc2" +String jacksonVersion = "2.14.0-rc3" dependencies { compileOnly project(':libs:elasticsearch-core') From 0c43661177a67a19895297b2952669bac36cb0f8 Mon Sep 17 00:00:00 2001 From: ChrisHegarty Date: Mon, 7 Nov 2022 08:29:38 +0000 Subject: [PATCH 4/5] set version to no rc --- gradle/verification-metadata.xml | 24 ++++++++++++------------ libs/x-content/impl/build.gradle | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index f6bb85c16f1d1..858a850780756 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -244,9 +244,9 @@ - - - + + + @@ -284,9 +284,9 @@ - - - + + + @@ -294,9 +294,9 @@ - - - + + + @@ -309,9 +309,9 @@ - - - + + + diff --git a/libs/x-content/impl/build.gradle b/libs/x-content/impl/build.gradle index 3525c2e319162..0588efe9889c5 100644 --- a/libs/x-content/impl/build.gradle +++ b/libs/x-content/impl/build.gradle @@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.java' archivesBaseName = "x-content-impl" -String jacksonVersion = "2.14.0-rc3" +String jacksonVersion = "2.14.0" dependencies { compileOnly project(':libs:elasticsearch-core') From a8ad72247f6ddff4d4eb3add54d357369a6c9142 Mon Sep 17 00:00:00 2001 From: Chris Hegarty <62058229+ChrisHegarty@users.noreply.github.com> Date: Mon, 7 Nov 2022 16:39:09 +0000 Subject: [PATCH 5/5] Update docs/changelog/90553.yaml --- docs/changelog/90553.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/90553.yaml diff --git a/docs/changelog/90553.yaml b/docs/changelog/90553.yaml new file mode 100644 index 0000000000000..d6cfdbc48e4f3 --- /dev/null +++ b/docs/changelog/90553.yaml @@ -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: []