From ea366bd820f977cb1fb421dac59fbc50c41882c1 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 18:42:43 -0400 Subject: [PATCH 01/18] Upgrade to Jackson 2.10.3 This commit upgrades our Jackson dependency to 2.10.3. We intentionally exclude ingest-geoip, we will handle that one separately. --- buildSrc/version.properties | 6 +++--- client/sniffer/licenses/jackson-core-2.10.3.jar.sha1 | 1 + client/sniffer/licenses/jackson-core-2.8.11.jar.sha1 | 1 - libs/x-content/licenses/jackson-core-2.10.3.jar.sha1 | 1 + libs/x-content/licenses/jackson-core-2.8.11.jar.sha1 | 1 - .../licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 | 1 + .../licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 | 1 - .../licenses/jackson-dataformat-smile-2.10.3.jar.sha1 | 1 + .../licenses/jackson-dataformat-smile-2.8.11.jar.sha1 | 1 - .../licenses/jackson-dataformat-yaml-2.10.3.jar.sha1 | 1 + .../licenses/jackson-dataformat-yaml-2.8.11.jar.sha1 | 1 - libs/x-content/licenses/snakeyaml-1.17.jar.sha1 | 1 - libs/x-content/licenses/snakeyaml-1.24.jar.sha1 | 1 + modules/ingest-geoip/build.gradle | 4 ++-- .../licenses/jackson-databind-2.8.11.4.jar.sha1 | 1 - .../licenses/jackson-databind-2.8.11.6.jar.sha1 | 1 + .../licenses/jackson-annotations-2.10.3.jar.sha1 | 1 + .../licenses/jackson-annotations-2.8.11.jar.sha1 | 1 - .../discovery-ec2/licenses/jackson-databind-2.10.3.jar.sha1 | 1 + .../licenses/jackson-databind-2.8.11.4.jar.sha1 | 1 - .../licenses/jackson-annotations-2.10.3.jar.sha1 | 1 + .../licenses/jackson-annotations-2.8.11.jar.sha1 | 1 - .../repository-s3/licenses/jackson-databind-2.10.3.jar.sha1 | 1 + .../licenses/jackson-databind-2.8.11.4.jar.sha1 | 1 - .../plugin/sql/jdbc/licenses/jackson-core-2.10.3.jar.sha1 | 1 + .../plugin/sql/jdbc/licenses/jackson-core-2.8.11.jar.sha1 | 1 - .../jdbc/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 | 1 + .../jdbc/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 | 1 - .../sql/sql-action/licenses/jackson-core-2.10.3.jar.sha1 | 1 + .../sql/sql-action/licenses/jackson-core-2.8.11.jar.sha1 | 1 - .../sql/sql-client/licenses/jackson-core-2.10.3.jar.sha1 | 1 + .../sql/sql-client/licenses/jackson-core-2.8.11.jar.sha1 | 1 - .../sql/sql-proto/licenses/jackson-core-2.10.3.jar.sha1 | 1 + .../sql/sql-proto/licenses/jackson-core-2.8.11.jar.sha1 | 1 - 34 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 client/sniffer/licenses/jackson-core-2.10.3.jar.sha1 delete mode 100644 client/sniffer/licenses/jackson-core-2.8.11.jar.sha1 create mode 100644 libs/x-content/licenses/jackson-core-2.10.3.jar.sha1 delete mode 100644 libs/x-content/licenses/jackson-core-2.8.11.jar.sha1 create mode 100644 libs/x-content/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 delete mode 100644 libs/x-content/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 create mode 100644 libs/x-content/licenses/jackson-dataformat-smile-2.10.3.jar.sha1 delete mode 100644 libs/x-content/licenses/jackson-dataformat-smile-2.8.11.jar.sha1 create mode 100644 libs/x-content/licenses/jackson-dataformat-yaml-2.10.3.jar.sha1 delete mode 100644 libs/x-content/licenses/jackson-dataformat-yaml-2.8.11.jar.sha1 delete mode 100644 libs/x-content/licenses/snakeyaml-1.17.jar.sha1 create mode 100644 libs/x-content/licenses/snakeyaml-1.24.jar.sha1 delete mode 100644 modules/ingest-geoip/licenses/jackson-databind-2.8.11.4.jar.sha1 create mode 100644 modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 create mode 100644 plugins/discovery-ec2/licenses/jackson-annotations-2.10.3.jar.sha1 delete mode 100644 plugins/discovery-ec2/licenses/jackson-annotations-2.8.11.jar.sha1 create mode 100644 plugins/discovery-ec2/licenses/jackson-databind-2.10.3.jar.sha1 delete mode 100644 plugins/discovery-ec2/licenses/jackson-databind-2.8.11.4.jar.sha1 create mode 100644 plugins/repository-s3/licenses/jackson-annotations-2.10.3.jar.sha1 delete mode 100644 plugins/repository-s3/licenses/jackson-annotations-2.8.11.jar.sha1 create mode 100644 plugins/repository-s3/licenses/jackson-databind-2.10.3.jar.sha1 delete mode 100644 plugins/repository-s3/licenses/jackson-databind-2.8.11.4.jar.sha1 create mode 100644 x-pack/plugin/sql/jdbc/licenses/jackson-core-2.10.3.jar.sha1 delete mode 100644 x-pack/plugin/sql/jdbc/licenses/jackson-core-2.8.11.jar.sha1 create mode 100644 x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 delete mode 100644 x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 create mode 100644 x-pack/plugin/sql/sql-action/licenses/jackson-core-2.10.3.jar.sha1 delete mode 100644 x-pack/plugin/sql/sql-action/licenses/jackson-core-2.8.11.jar.sha1 create mode 100644 x-pack/plugin/sql/sql-client/licenses/jackson-core-2.10.3.jar.sha1 delete mode 100644 x-pack/plugin/sql/sql-client/licenses/jackson-core-2.8.11.jar.sha1 create mode 100644 x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.10.3.jar.sha1 delete mode 100644 x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.8.11.jar.sha1 diff --git a/buildSrc/version.properties b/buildSrc/version.properties index e9278d0c4a554..1652abf5d48cd 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -10,9 +10,9 @@ jts = 1.15.0 # note that ingest-geoip has a hard-coded version; if you modify this version, # you should also inspect that version to see if it can be advanced along with # the com.maxmind.geoip2:geoip2 dependency -jackson = 2.8.11 -jacksondatabind = 2.8.11.4 -snakeyaml = 1.17 +jackson = 2.10.3 +jacksondatabind = 2.10.3 +snakeyaml = 1.24 icu4j = 62.1 supercsv = 2.4.0 # when updating log4j, please update also docs/java-api/index.asciidoc diff --git a/client/sniffer/licenses/jackson-core-2.10.3.jar.sha1 b/client/sniffer/licenses/jackson-core-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..f23937b0d82a4 --- /dev/null +++ b/client/sniffer/licenses/jackson-core-2.10.3.jar.sha1 @@ -0,0 +1 @@ +f7ee7b55c7d292ac72fbaa7648c089f069c938d2 \ No newline at end of file diff --git a/client/sniffer/licenses/jackson-core-2.8.11.jar.sha1 b/client/sniffer/licenses/jackson-core-2.8.11.jar.sha1 deleted file mode 100644 index e7ad1e74ed6b8..0000000000000 --- a/client/sniffer/licenses/jackson-core-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -876ead1db19f0c9e79c9789273a3ef8c6fd6c29b \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-core-2.10.3.jar.sha1 b/libs/x-content/licenses/jackson-core-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..f23937b0d82a4 --- /dev/null +++ b/libs/x-content/licenses/jackson-core-2.10.3.jar.sha1 @@ -0,0 +1 @@ +f7ee7b55c7d292ac72fbaa7648c089f069c938d2 \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-core-2.8.11.jar.sha1 b/libs/x-content/licenses/jackson-core-2.8.11.jar.sha1 deleted file mode 100644 index e7ad1e74ed6b8..0000000000000 --- a/libs/x-content/licenses/jackson-core-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -876ead1db19f0c9e79c9789273a3ef8c6fd6c29b \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..6c96c20f48232 --- /dev/null +++ b/libs/x-content/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 @@ -0,0 +1 @@ +1ba01fef9c3b7ed388d91e71dc733b315c7374cd \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 deleted file mode 100644 index 378ba524422bc..0000000000000 --- a/libs/x-content/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -8b9826e16c3366764bfb7ad7362554f0471046c3 \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-dataformat-smile-2.10.3.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-smile-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..24ac4b32095e4 --- /dev/null +++ b/libs/x-content/licenses/jackson-dataformat-smile-2.10.3.jar.sha1 @@ -0,0 +1 @@ +ff397547ff168e77279a1cd549e2ca4923c991aa \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-dataformat-smile-2.8.11.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-smile-2.8.11.jar.sha1 deleted file mode 100644 index 510afb3df53e6..0000000000000 --- a/libs/x-content/licenses/jackson-dataformat-smile-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d9d1c49c5d9d5e46e2aee55f3cdd119286fe0fc1 \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-dataformat-yaml-2.10.3.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-yaml-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..8f1ecab9ecb38 --- /dev/null +++ b/libs/x-content/licenses/jackson-dataformat-yaml-2.10.3.jar.sha1 @@ -0,0 +1 @@ +4dc1a172812d9da27c1afd6a08f4f12aad7b14dd \ No newline at end of file diff --git a/libs/x-content/licenses/jackson-dataformat-yaml-2.8.11.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-yaml-2.8.11.jar.sha1 deleted file mode 100644 index 78a68d715ec3d..0000000000000 --- a/libs/x-content/licenses/jackson-dataformat-yaml-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2e77c6ff7342cd61ab1ae7cb14ed16aebfc8a72a \ No newline at end of file diff --git a/libs/x-content/licenses/snakeyaml-1.17.jar.sha1 b/libs/x-content/licenses/snakeyaml-1.17.jar.sha1 deleted file mode 100644 index 9ac6e87f2244a..0000000000000 --- a/libs/x-content/licenses/snakeyaml-1.17.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7a27ea250c5130b2922b86dea63cbb1cc10a660c \ No newline at end of file diff --git a/libs/x-content/licenses/snakeyaml-1.24.jar.sha1 b/libs/x-content/licenses/snakeyaml-1.24.jar.sha1 new file mode 100644 index 0000000000000..a6e7bd5a1e7c1 --- /dev/null +++ b/libs/x-content/licenses/snakeyaml-1.24.jar.sha1 @@ -0,0 +1 @@ +13a9c0d6776483c3876e3ff9384f9bb55b17001b \ No newline at end of file diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index ce9dc7d574c12..dd51d0a80357e 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -28,8 +28,8 @@ dependencies { // Upgrade to 2.10.0 or higher when jackson-core gets upgraded to 2.9.x. Blocked by #27032 compile('com.maxmind.geoip2:geoip2:2.9.0') // geoip2 dependencies: - compile("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") - compile("com.fasterxml.jackson.core:jackson-databind:${versions.jacksondatabind}") + compile("com.fasterxml.jackson.core:jackson-annotations:2.8.11") + compile("com.fasterxml.jackson.core:jackson-databind:2.8.11.6") compile('com.maxmind.db:maxmind-db:1.2.2') testCompile 'org.elasticsearch:geolite2-databases:20191119' diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.8.11.4.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.8.11.4.jar.sha1 deleted file mode 100644 index 5203969bcf5c0..0000000000000 --- a/modules/ingest-geoip/licenses/jackson-databind-2.8.11.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -596d6923ff4cf7ea72ded3ac32903b9c618ce9f1 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 new file mode 100644 index 0000000000000..f491259db56bc --- /dev/null +++ b/modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 @@ -0,0 +1 @@ +35753201d0cdb1dbe998ab289bca1180b68d4368 \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/jackson-annotations-2.10.3.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-annotations-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..9c725f2d90e69 --- /dev/null +++ b/plugins/discovery-ec2/licenses/jackson-annotations-2.10.3.jar.sha1 @@ -0,0 +1 @@ +0f63b3b1da563767d04d2e4d3fc1ae0cdeffebe7 \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/jackson-annotations-2.8.11.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-annotations-2.8.11.jar.sha1 deleted file mode 100644 index 30e7d1a7b1a74..0000000000000 --- a/plugins/discovery-ec2/licenses/jackson-annotations-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -391de20b4e29cb3fb07d2454ace64be2c82ac91f \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.10.3.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..688ae92d10792 --- /dev/null +++ b/plugins/discovery-ec2/licenses/jackson-databind-2.10.3.jar.sha1 @@ -0,0 +1 @@ +aae92628b5447fa25af79871ca98668da6edd439 \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.8.11.4.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.8.11.4.jar.sha1 deleted file mode 100644 index 5203969bcf5c0..0000000000000 --- a/plugins/discovery-ec2/licenses/jackson-databind-2.8.11.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -596d6923ff4cf7ea72ded3ac32903b9c618ce9f1 \ No newline at end of file diff --git a/plugins/repository-s3/licenses/jackson-annotations-2.10.3.jar.sha1 b/plugins/repository-s3/licenses/jackson-annotations-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..9c725f2d90e69 --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-annotations-2.10.3.jar.sha1 @@ -0,0 +1 @@ +0f63b3b1da563767d04d2e4d3fc1ae0cdeffebe7 \ No newline at end of file diff --git a/plugins/repository-s3/licenses/jackson-annotations-2.8.11.jar.sha1 b/plugins/repository-s3/licenses/jackson-annotations-2.8.11.jar.sha1 deleted file mode 100644 index 30e7d1a7b1a74..0000000000000 --- a/plugins/repository-s3/licenses/jackson-annotations-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -391de20b4e29cb3fb07d2454ace64be2c82ac91f \ No newline at end of file diff --git a/plugins/repository-s3/licenses/jackson-databind-2.10.3.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..688ae92d10792 --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-databind-2.10.3.jar.sha1 @@ -0,0 +1 @@ +aae92628b5447fa25af79871ca98668da6edd439 \ No newline at end of file diff --git a/plugins/repository-s3/licenses/jackson-databind-2.8.11.4.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.8.11.4.jar.sha1 deleted file mode 100644 index 5203969bcf5c0..0000000000000 --- a/plugins/repository-s3/licenses/jackson-databind-2.8.11.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -596d6923ff4cf7ea72ded3ac32903b9c618ce9f1 \ No newline at end of file diff --git a/x-pack/plugin/sql/jdbc/licenses/jackson-core-2.10.3.jar.sha1 b/x-pack/plugin/sql/jdbc/licenses/jackson-core-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..f23937b0d82a4 --- /dev/null +++ b/x-pack/plugin/sql/jdbc/licenses/jackson-core-2.10.3.jar.sha1 @@ -0,0 +1 @@ +f7ee7b55c7d292ac72fbaa7648c089f069c938d2 \ No newline at end of file diff --git a/x-pack/plugin/sql/jdbc/licenses/jackson-core-2.8.11.jar.sha1 b/x-pack/plugin/sql/jdbc/licenses/jackson-core-2.8.11.jar.sha1 deleted file mode 100644 index e7ad1e74ed6b8..0000000000000 --- a/x-pack/plugin/sql/jdbc/licenses/jackson-core-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -876ead1db19f0c9e79c9789273a3ef8c6fd6c29b \ No newline at end of file diff --git a/x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 b/x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..6c96c20f48232 --- /dev/null +++ b/x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.10.3.jar.sha1 @@ -0,0 +1 @@ +1ba01fef9c3b7ed388d91e71dc733b315c7374cd \ No newline at end of file diff --git a/x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 b/x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 deleted file mode 100644 index 378ba524422bc..0000000000000 --- a/x-pack/plugin/sql/jdbc/licenses/jackson-dataformat-cbor-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -8b9826e16c3366764bfb7ad7362554f0471046c3 \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.10.3.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..f23937b0d82a4 --- /dev/null +++ b/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.10.3.jar.sha1 @@ -0,0 +1 @@ +f7ee7b55c7d292ac72fbaa7648c089f069c938d2 \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.8.11.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.8.11.jar.sha1 deleted file mode 100644 index e7ad1e74ed6b8..0000000000000 --- a/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -876ead1db19f0c9e79c9789273a3ef8c6fd6c29b \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.10.3.jar.sha1 b/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..f23937b0d82a4 --- /dev/null +++ b/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.10.3.jar.sha1 @@ -0,0 +1 @@ +f7ee7b55c7d292ac72fbaa7648c089f069c938d2 \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.8.11.jar.sha1 b/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.8.11.jar.sha1 deleted file mode 100644 index e7ad1e74ed6b8..0000000000000 --- a/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -876ead1db19f0c9e79c9789273a3ef8c6fd6c29b \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.10.3.jar.sha1 b/x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..f23937b0d82a4 --- /dev/null +++ b/x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.10.3.jar.sha1 @@ -0,0 +1 @@ +f7ee7b55c7d292ac72fbaa7648c089f069c938d2 \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.8.11.jar.sha1 b/x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.8.11.jar.sha1 deleted file mode 100644 index e7ad1e74ed6b8..0000000000000 --- a/x-pack/plugin/sql/sql-proto/licenses/jackson-core-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -876ead1db19f0c9e79c9789273a3ef8c6fd6c29b \ No newline at end of file From 2551bc3cb7c1b02f95caf9b686d2dfd0a9027019 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 18:54:06 -0400 Subject: [PATCH 02/18] Fix third party audit --- libs/x-content/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/x-content/build.gradle b/libs/x-content/build.gradle index 14adf7d102d78..be056980ef50d 100644 --- a/libs/x-content/build.gradle +++ b/libs/x-content/build.gradle @@ -49,6 +49,7 @@ forbiddenApisMain { thirdPartyAudit.ignoreMissingClasses( // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) 'com.fasterxml.jackson.databind.ObjectMapper', + 'com.fasterxml.jackson.databind.cfg.MapperBuilder' ) dependencyLicenses { From d8a3b9acc4de5cf7aa83a4ce41c03589fcc4cfcd Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 19:04:30 -0400 Subject: [PATCH 03/18] Fix third party audit --- x-pack/plugin/sql/jdbc/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/plugin/sql/jdbc/build.gradle b/x-pack/plugin/sql/jdbc/build.gradle index 7cdec567ef8f4..dc42f90476571 100644 --- a/x-pack/plugin/sql/jdbc/build.gradle +++ b/x-pack/plugin/sql/jdbc/build.gradle @@ -44,3 +44,8 @@ dependencyLicenses { shadowJar { relocate 'com.fasterxml', 'org.elasticsearch.fasterxml' } + +thirdPartyAudit.ignoreMissingClasses( + 'com.fasterxml.jackson.databind.ObjectMapper', + 'com.fasterxml.jackson.databind.cfg.MapperBuilder' +) From 4a7dc521a7cea84e7b24168c68917a90a9601ceb Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 19:20:11 -0400 Subject: [PATCH 04/18] Fix test --- .../common/xcontent/XContentParserTests.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java index 0cfa01876c590..55469c6b15c5c 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java @@ -78,15 +78,7 @@ public void testFloat() throws IOException { assertEquals(value, number.floatValue(), 0.0f); - if (xContentType == XContentType.CBOR) { - // CBOR parses back a float - assertTrue(number instanceof Float); - } else { - // JSON, YAML and SMILE parses back the float value as a double - // This will change for SMILE in Jackson 2.9 where all binary based - // formats will return a float - assertTrue(number instanceof Double); - } + assertTrue(number instanceof Float); } } From ec2c92b62a2508c113695c559c06d29f3f210956 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 19:34:07 -0400 Subject: [PATCH 05/18] Fix assertion --- .../org/elasticsearch/common/xcontent/XContentParserTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java index 55469c6b15c5c..534a66f4d4c58 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java @@ -78,7 +78,7 @@ public void testFloat() throws IOException { assertEquals(value, number.floatValue(), 0.0f); - assertTrue(number instanceof Float); + assertThat(number, instanceOf(Float.class)); } } From 8846ea7a14ae90ff6c17dfdbe5bb8b8df771b07b Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 20:42:18 -0400 Subject: [PATCH 06/18] Update ingest-geoip to 2.13.1 --- modules/ingest-geoip/build.gradle | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index 040b1ae7cb1d8..1eb116c902db3 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -25,10 +25,9 @@ esplugin { } dependencies { - // Upgrade to 2.10.0 or higher when jackson-core gets upgraded to 2.9.x. Blocked by #27032 - compile('com.maxmind.geoip2:geoip2:2.9.0') + compile('com.maxmind.geoip2:geoip2:2.13.1') // geoip2 dependencies: - compile("com.fasterxml.jackson.core:${versions.jackson}") + compile("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") compile("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}") compile('com.maxmind.db:maxmind-db:1.2.2') From 2eb85c19e72760096adc35572b3784698911cd07 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 20:54:22 -0400 Subject: [PATCH 07/18] Fix SHAs --- modules/ingest-geoip/licenses/geoip2-2.13.1.jar.sha1 | 1 + modules/ingest-geoip/licenses/geoip2-2.9.0.jar.sha1 | 1 - .../ingest-geoip/licenses/jackson-annotations-2.10.3.jar.sha1 | 1 + .../ingest-geoip/licenses/jackson-annotations-2.8.11.jar.sha1 | 1 - modules/ingest-geoip/licenses/jackson-databind-2.10.3.jar.sha1 | 1 + modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 | 1 - .../discovery-ec2/licenses/jackson-databind-2.8.11.6.jar.sha1 | 1 - .../repository-s3/licenses/jackson-databind-2.8.11.6.jar.sha1 | 1 - 8 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 modules/ingest-geoip/licenses/geoip2-2.13.1.jar.sha1 delete mode 100644 modules/ingest-geoip/licenses/geoip2-2.9.0.jar.sha1 create mode 100644 modules/ingest-geoip/licenses/jackson-annotations-2.10.3.jar.sha1 delete mode 100644 modules/ingest-geoip/licenses/jackson-annotations-2.8.11.jar.sha1 create mode 100644 modules/ingest-geoip/licenses/jackson-databind-2.10.3.jar.sha1 delete mode 100644 modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 delete mode 100644 plugins/discovery-ec2/licenses/jackson-databind-2.8.11.6.jar.sha1 delete mode 100644 plugins/repository-s3/licenses/jackson-databind-2.8.11.6.jar.sha1 diff --git a/modules/ingest-geoip/licenses/geoip2-2.13.1.jar.sha1 b/modules/ingest-geoip/licenses/geoip2-2.13.1.jar.sha1 new file mode 100644 index 0000000000000..253d9f12e7a3a --- /dev/null +++ b/modules/ingest-geoip/licenses/geoip2-2.13.1.jar.sha1 @@ -0,0 +1 @@ +f27d1a49d5a29dd4a7ac5006ce2eb16b8b9bb888 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/geoip2-2.9.0.jar.sha1 b/modules/ingest-geoip/licenses/geoip2-2.9.0.jar.sha1 deleted file mode 100644 index 8cb79bbb9207a..0000000000000 --- a/modules/ingest-geoip/licenses/geoip2-2.9.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c12b463a2c10824225c0b27952c49b464cb0e4c6 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/jackson-annotations-2.10.3.jar.sha1 b/modules/ingest-geoip/licenses/jackson-annotations-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..9c725f2d90e69 --- /dev/null +++ b/modules/ingest-geoip/licenses/jackson-annotations-2.10.3.jar.sha1 @@ -0,0 +1 @@ +0f63b3b1da563767d04d2e4d3fc1ae0cdeffebe7 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/jackson-annotations-2.8.11.jar.sha1 b/modules/ingest-geoip/licenses/jackson-annotations-2.8.11.jar.sha1 deleted file mode 100644 index 30e7d1a7b1a74..0000000000000 --- a/modules/ingest-geoip/licenses/jackson-annotations-2.8.11.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -391de20b4e29cb3fb07d2454ace64be2c82ac91f \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.10.3.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.10.3.jar.sha1 new file mode 100644 index 0000000000000..688ae92d10792 --- /dev/null +++ b/modules/ingest-geoip/licenses/jackson-databind-2.10.3.jar.sha1 @@ -0,0 +1 @@ +aae92628b5447fa25af79871ca98668da6edd439 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 deleted file mode 100644 index f491259db56bc..0000000000000 --- a/modules/ingest-geoip/licenses/jackson-databind-2.8.11.6.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -35753201d0cdb1dbe998ab289bca1180b68d4368 \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.8.11.6.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.8.11.6.jar.sha1 deleted file mode 100644 index f491259db56bc..0000000000000 --- a/plugins/discovery-ec2/licenses/jackson-databind-2.8.11.6.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -35753201d0cdb1dbe998ab289bca1180b68d4368 \ No newline at end of file diff --git a/plugins/repository-s3/licenses/jackson-databind-2.8.11.6.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.8.11.6.jar.sha1 deleted file mode 100644 index f491259db56bc..0000000000000 --- a/plugins/repository-s3/licenses/jackson-databind-2.8.11.6.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -35753201d0cdb1dbe998ab289bca1180b68d4368 \ No newline at end of file From 58da2f4e2a56de8153505efe2c9099555b8dd013 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 21:02:24 -0400 Subject: [PATCH 08/18] Fix version --- modules/ingest-geoip/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index 1eb116c902db3..dfa165e566170 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -29,7 +29,7 @@ dependencies { // geoip2 dependencies: compile("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") compile("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}") - compile('com.maxmind.db:maxmind-db:1.2.2') + compile('com.maxmind.db:maxmind-db:1.3.1') testCompile 'org.elasticsearch:geolite2-databases:20191119' } From 42d428ef21edf3c7d8f20e14019c15e9e92b3c0f Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 21:03:10 -0400 Subject: [PATCH 09/18] Fix SHAs --- modules/ingest-geoip/licenses/maxmind-db-1.2.2.jar.sha1 | 1 - modules/ingest-geoip/licenses/maxmind-db-1.3.1.jar.sha1 | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 modules/ingest-geoip/licenses/maxmind-db-1.2.2.jar.sha1 create mode 100644 modules/ingest-geoip/licenses/maxmind-db-1.3.1.jar.sha1 diff --git a/modules/ingest-geoip/licenses/maxmind-db-1.2.2.jar.sha1 b/modules/ingest-geoip/licenses/maxmind-db-1.2.2.jar.sha1 deleted file mode 100644 index 3dd3ad36f4cc3..0000000000000 --- a/modules/ingest-geoip/licenses/maxmind-db-1.2.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -78c22a03de1e222b0751855aff7bb6e6db5569e5 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/maxmind-db-1.3.1.jar.sha1 b/modules/ingest-geoip/licenses/maxmind-db-1.3.1.jar.sha1 new file mode 100644 index 0000000000000..aebff2c3a849c --- /dev/null +++ b/modules/ingest-geoip/licenses/maxmind-db-1.3.1.jar.sha1 @@ -0,0 +1 @@ +211bca628225bc0f719051b16deb03a747d7a14f \ No newline at end of file From 0717f9c7beb197bb75e74e6713d5ca25b3e1f51c Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 21:13:31 -0400 Subject: [PATCH 10/18] Fix test again --- .../common/xcontent/XContentParserTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java index 534a66f4d4c58..d361bd878c5ee 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java @@ -78,6 +78,19 @@ public void testFloat() throws IOException { assertEquals(value, number.floatValue(), 0.0f); + switch (xContentType) { + case CBOR: + case SMILE: + assertThat(number, instanceOf(Float.class)); + break; + case JSON: + case YAML: + assertThat(number, instanceOf(Float.class)); + break; + default: + throw new AssertionError("unexpected x-content type [" + xContentType + "]"); + } + assertThat(number, instanceOf(Float.class)); } } From 9cebc8761f5836fea2a821868cbf8bfa7b563c45 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 21:44:56 -0400 Subject: [PATCH 11/18] Fix tests --- .../elasticsearch/ingest/common/JsonProcessorTests.java | 9 +++++++-- .../org/elasticsearch/index/IndexingSlowLogTests.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java index 099e8e1866b8e..c9e81ccf4c811 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/JsonProcessorTests.java @@ -65,7 +65,7 @@ public void testInvalidValue() { Exception exception = expectThrows(IllegalArgumentException.class, () -> jsonProcessor.execute(ingestDocument)); assertThat(exception.getCause().getMessage(), containsString("Unrecognized token 'blah': " + - "was expecting ('true', 'false' or 'null')")); + "was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')")); } public void testByteArray() { @@ -75,7 +75,12 @@ public void testByteArray() { IngestDocument ingestDocument = RandomDocumentPicks.randomIngestDocument(random(), document); Exception exception = expectThrows(IllegalArgumentException.class, () -> jsonProcessor.execute(ingestDocument)); - assertThat(exception.getCause().getMessage(), containsString("Unrecognized token 'B': was expecting ('true', 'false' or 'null')")); + assertThat( + exception.getCause().getMessage(), + containsString( + "Unrecognized token 'B': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')" + ) + ); } public void testNull() throws Exception { diff --git a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java index dbff49460015b..94a59df59d6e1 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java @@ -103,7 +103,7 @@ public void testSlowLogParsedDocumentPrinterSourceToLog() throws IOException { final UncheckedIOException e = expectThrows(UncheckedIOException.class, () -> IndexingSlowLogMessage.of(index, doc, 10, true, 3)); assertThat(e, hasToString(containsString("_failed_to_convert_[Unrecognized token 'invalid':" - + " was expecting ('true', 'false' or 'null')\\n" + + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\\n" + " at [Source: org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper"))); assertNotNull(e.getCause()); assertThat(e.getCause(), instanceOf(JsonParseException.class)); From 47fd29baef0284e0f9886eb28b5721321fa0bd92 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 21:46:21 -0400 Subject: [PATCH 12/18] Fix tests --- .../elasticsearch/xpack/sql/client/RemoteFailureTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java index 2029493bcbec4..f709526b1f9b6 100644 --- a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java @@ -92,7 +92,8 @@ public void testNoType() { public void testInvalidJson() { IOException e = expectThrows(IOException.class, () -> parse("invalid_json.txt")); assertEquals( - "Can't parse error from Elasticsearch [Unrecognized token 'I': was expecting 'null', 'true', 'false' or NaN] " + "Can't parse error from Elasticsearch [Unrecognized token 'I': " + + "was expecting JSON String, Number, Array, Object or token 'null', 'true' or 'false'] " + "at [line 1 col 1]. Response:\n" + "I'm not json at all", e.getMessage()); @@ -118,7 +119,7 @@ public void testTotalGarbage() { }).streamInput())); assertThat(e.getMessage(), startsWith("Can't parse error from Elasticsearch [Unrecognized token 'ÿ': " - + "was expecting ('true', 'false' or 'null')] at [line 1 col 1]. Response:\n")); + + "was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')] at [line 1 col 1]. Response:\n")); } public void testTooBig() { From 10c49d6b69038509abb930528d5302bc7bb6e3b0 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 Mar 2020 22:01:21 -0400 Subject: [PATCH 13/18] Fix silly error --- .../org/elasticsearch/common/xcontent/XContentParserTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java index d361bd878c5ee..7f0b31f5a781f 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java @@ -85,7 +85,7 @@ public void testFloat() throws IOException { break; case JSON: case YAML: - assertThat(number, instanceOf(Float.class)); + assertThat(number, instanceOf(Double.class)); break; default: throw new AssertionError("unexpected x-content type [" + xContentType + "]"); From 0860d0829e15bbe2bacd47edaa96fcf33ce6cb48 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 13 Mar 2020 15:04:25 -0400 Subject: [PATCH 14/18] Fix test --- .../java/org/elasticsearch/index/IndexingSlowLogTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java index 94a59df59d6e1..5cd24cbb282f1 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java @@ -103,12 +103,12 @@ public void testSlowLogParsedDocumentPrinterSourceToLog() throws IOException { final UncheckedIOException e = expectThrows(UncheckedIOException.class, () -> IndexingSlowLogMessage.of(index, doc, 10, true, 3)); assertThat(e, hasToString(containsString("_failed_to_convert_[Unrecognized token 'invalid':" - + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\\n" + + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n" + " at [Source: org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper"))); assertNotNull(e.getCause()); assertThat(e.getCause(), instanceOf(JsonParseException.class)); assertThat(e.getCause(), hasToString(containsString("Unrecognized token 'invalid':" - + " was expecting ('true', 'false' or 'null')\n" + + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n" + " at [Source: org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper"))); } From a86032cc6c6bc732199ae2c556300eb9de94d9be Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 13 Mar 2020 15:15:36 -0400 Subject: [PATCH 15/18] Remove leftover statement --- .../org/elasticsearch/common/xcontent/XContentParserTests.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java index 7f0b31f5a781f..66c0041723e8c 100644 --- a/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java +++ b/libs/x-content/src/test/java/org/elasticsearch/common/xcontent/XContentParserTests.java @@ -90,8 +90,6 @@ public void testFloat() throws IOException { default: throw new AssertionError("unexpected x-content type [" + xContentType + "]"); } - - assertThat(number, instanceOf(Float.class)); } } From 5944d1a52a82bdbaffbe4993d6cf9ba1921667a6 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 14 Mar 2020 07:36:21 -0400 Subject: [PATCH 16/18] Fix test --- .../elasticsearch/xpack/sql/client/RemoteFailureTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java index f709526b1f9b6..de5a1d3002ee9 100644 --- a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java @@ -93,8 +93,8 @@ public void testInvalidJson() { IOException e = expectThrows(IOException.class, () -> parse("invalid_json.txt")); assertEquals( "Can't parse error from Elasticsearch [Unrecognized token 'I': " - + "was expecting JSON String, Number, Array, Object or token 'null', 'true' or 'false'] " - + "at [line 1 col 1]. Response:\n" + + "was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')] " + + "at [line 1 col 4]. Response:\n" + "I'm not json at all", e.getMessage()); } From 204e142b969665314ab9ffc2a7048586a895094d Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 14 Mar 2020 08:25:12 -0400 Subject: [PATCH 17/18] Fix tests --- .../common/xcontent/XContentParserUtilsTests.java | 11 +---------- .../org/elasticsearch/index/IndexingSlowLogTests.java | 6 +++--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java b/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java index db3dabdcafe49..6b99f28f3a8c1 100644 --- a/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java +++ b/server/src/test/java/org/elasticsearch/common/xcontent/XContentParserUtilsTests.java @@ -31,7 +31,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.Base64; import java.util.List; import java.util.Map; @@ -90,15 +89,7 @@ public void testStoredFieldsValueBoolean() throws IOException { public void testStoredFieldsValueBinary() throws IOException { final byte[] value = randomUnicodeOfLength(scaledRandomIntBetween(10, 1000)).getBytes("UTF-8"); - assertParseFieldsSimpleValue(value, (xcontentType, result) -> { - if (xcontentType == XContentType.JSON || xcontentType == XContentType.YAML) { - //binary values will be parsed back and returned as base64 strings when reading from json and yaml - assertArrayEquals(value, Base64.getDecoder().decode((String) result)); - } else { - //binary values will be parsed back and returned as BytesArray when reading from cbor and smile - assertArrayEquals(value, ((BytesArray) result).array()); - } - }); + assertParseFieldsSimpleValue(value, (xcontentType, result) -> assertArrayEquals(value, ((BytesArray) result).array())); } public void testStoredFieldsValueNull() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java index 5cd24cbb282f1..78d25e996ab2a 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java @@ -103,13 +103,13 @@ public void testSlowLogParsedDocumentPrinterSourceToLog() throws IOException { final UncheckedIOException e = expectThrows(UncheckedIOException.class, () -> IndexingSlowLogMessage.of(index, doc, 10, true, 3)); assertThat(e, hasToString(containsString("_failed_to_convert_[Unrecognized token 'invalid':" - + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n" - + " at [Source: org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper"))); + + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\\n" + + " at [Source: (org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper)"))); assertNotNull(e.getCause()); assertThat(e.getCause(), instanceOf(JsonParseException.class)); assertThat(e.getCause(), hasToString(containsString("Unrecognized token 'invalid':" + " was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n" - + " at [Source: org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper"))); + + " at [Source: (org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper)"))); } public void testReformatSetting() { From 49547f0d2f9546572eb6df657dc14149526e7b91 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 14 Mar 2020 09:17:36 -0400 Subject: [PATCH 18/18] Fix tests --- .../elasticsearch/xpack/sql/client/RemoteFailureTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java index de5a1d3002ee9..1409e80837768 100644 --- a/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java @@ -94,7 +94,7 @@ public void testInvalidJson() { assertEquals( "Can't parse error from Elasticsearch [Unrecognized token 'I': " + "was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')] " - + "at [line 1 col 4]. Response:\n" + + "at [line 1 col 1]. Response:\n" + "I'm not json at all", e.getMessage()); } @@ -119,7 +119,7 @@ public void testTotalGarbage() { }).streamInput())); assertThat(e.getMessage(), startsWith("Can't parse error from Elasticsearch [Unrecognized token 'ÿ': " - + "was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')] at [line 1 col 1]. Response:\n")); + + "was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')] at [line 1 col 4]. Response:\n")); } public void testTooBig() {