From 4da5e611c909f871f7ac2eee7283af6a343e31c3 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 17:03:12 +0200 Subject: [PATCH] Replace Jackson serde (#10035) JSON serialization setup between Language Server and Runtime is a major contributor to startup time. This PR experiments with an alternative implementation that remedies the problem. The new serializer uses [jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala) which by some accounts claims to be really fast. In our case, more importantly, we pay negligible cost of startup setup compared to Jackson which was horribly slow. # Important Notes Before: ![Screenshot from 2024-06-06 15-35-18](https://github.com/enso-org/enso/assets/292128/56103b82-777e-459f-966e-abdef25c2430) After: ![Screenshot from 2024-06-06 15-35-02](https://github.com/enso-org/enso/assets/292128/00a36647-dfae-4dc8-a1b7-bf69069ef109) Yes. About 0.8sec. --- build.sbt | 34 +- distribution/engine/THIRD-PARTY/NOTICE | 19 +- .../CREDITS-2.x.txt | 145 ---- .../LICENSE | 8 - .../NOTICES | 1 - .../LICENSE | 21 + .../LICENSE | 21 + .../NOTICES | 121 ---- .../project-manager/THIRD-PARTY/NOTICE | 17 +- .../CREDITS-2.x.txt | 145 ---- .../LICENSE | 8 - .../NOTICES | 29 - .../LICENSE | 21 + .../LICENSE | 21 + .../NOTICES | 121 ---- .../runtime/RuntimeConnector.scala | 6 +- .../enso/polyglot/macros/SerdeConfig.scala | 46 ++ .../scala/org/enso/polyglot/DocSection.scala | 44 +- .../org/enso/polyglot/ExportedSymbol.scala | 27 +- .../scala/org/enso/polyglot/Suggestion.scala | 68 +- .../scala/org/enso/polyglot/data/These.scala | 39 +- .../scala/org/enso/polyglot/data/Tree.scala | 38 +- .../org/enso/polyglot/data/TypeGraph.scala | 6 - .../org/enso/polyglot/runtime/Runtime.scala | 639 +++--------------- .../polyglot/runtime/serde/ApiSerde.scala | 40 ++ .../polyglot/runtime/serde/SerdeSpec.scala | 141 ++++ .../interpreter/instrument/Endpoint.scala | 7 +- .../instrument/job/EnsureCompiledJob.scala | 14 +- .../compiler/test/context/JacksonTest.java | 74 -- .../instrument/RuntimeServerEmulator.scala | 7 +- .../enso/interpreter/caches/CacheUtils.java | 12 +- .../files-add/CREDITS-2.x.txt | 145 ---- .../files-ignore | 2 - .../copyright-ignore | 1 - .../copyright-keep | 1 - .../files-keep | 1 - .../custom-license | 0 .../files-keep | 1 + .../custom-license | 1 + .../files-keep | 1 + .../copyright-add | 60 -- .../copyright-ignore | 9 - .../copyright-keep-context | 2 - .../custom-license | 1 - tools/legal-review/engine/report-state | 4 +- .../files-add/CREDITS-2.x.txt | 145 ---- .../files-ignore | 2 - .../copyright-add | 28 - .../copyright-ignore | 2 - .../default-and-custom-license | 0 .../files-keep | 1 - .../custom-license | 1 + .../files-keep | 1 + .../custom-license | 1 + .../files-keep | 1 + .../copyright-add | 60 -- .../copyright-ignore | 9 - .../copyright-keep-context | 2 - .../custom-license | 1 - .../legal-review/project-manager/report-state | 4 +- 60 files changed, 526 insertions(+), 1901 deletions(-) delete mode 100644 distribution/engine/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt delete mode 100644 distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE delete mode 100644 distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES create mode 100644 distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE create mode 100644 distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE delete mode 100644 distribution/engine/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES delete mode 100644 distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt delete mode 100644 distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE delete mode 100644 distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES create mode 100644 distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE create mode 100644 distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE delete mode 100644 distribution/project-manager/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES create mode 100644 engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala create mode 100644 engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala create mode 100644 engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala delete mode 100644 engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/context/JacksonTest.java delete mode 100644 tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt delete mode 100644 tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore delete mode 100644 tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore delete mode 100644 tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-keep delete mode 100644 tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep rename tools/legal-review/engine/{com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2 => com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5}/custom-license (100%) create mode 100644 tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep create mode 100644 tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license create mode 100644 tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep delete mode 100644 tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-add delete mode 100644 tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore delete mode 100644 tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context delete mode 100644 tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/custom-license delete mode 100644 tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt delete mode 100644 tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore delete mode 100644 tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-add delete mode 100644 tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore delete mode 100644 tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/default-and-custom-license delete mode 100644 tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep create mode 100644 tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license create mode 100644 tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep create mode 100644 tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license create mode 100644 tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep delete mode 100644 tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-add delete mode 100644 tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore delete mode 100644 tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context delete mode 100644 tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/custom-license diff --git a/build.sbt b/build.sbt index 829d21d758e..29b652daab7 100644 --- a/build.sbt +++ b/build.sbt @@ -285,6 +285,7 @@ lazy val enso = (project in file(".")) `json-rpc-server`, `language-server`, `polyglot-api`, + `polyglot-api-macros`, `project-manager`, `syntax-rust-definition`, `text-buffer`, @@ -480,11 +481,6 @@ val helidon = Seq( // === Jackson ================================================================ val jacksonVersion = "2.15.2" -val jackson = Seq( - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % jacksonVersion, - "com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion, - "com.fasterxml.jackson.module" %% "jackson-module-scala" % jacksonVersion -) // === JAXB ================================================================ @@ -563,6 +559,7 @@ val fansiVersion = "0.4.0" val httpComponentsVersion = "4.4.1" val apacheArrowVersion = "14.0.1" val snowflakeJDBCVersion = "3.15.0" +val jsoniterVersion = "2.28.5" // ============================================================================ // === Utility methods ===================================================== @@ -1437,8 +1434,6 @@ lazy val `engine-common` = project Test / fork := true, commands += WithDebugCommand.withDebug, Test / envVars ++= distributionEnvironmentOverrides, - Test / javaOptions ++= Seq( - ), libraryDependencies ++= Seq( "org.graalvm.polyglot" % "polyglot" % graalMavenPackagesVersion % "provided" ) @@ -1462,13 +1457,15 @@ lazy val `polyglot-api` = project "runtime-fat-jar" ) / Compile / fullClasspath).value, libraryDependencies ++= Seq( - "org.graalvm.sdk" % "polyglot-tck" % graalMavenPackagesVersion % "provided", - "org.graalvm.truffle" % "truffle-api" % graalMavenPackagesVersion % "provided", - "com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion, - "org.scalatest" %% "scalatest" % scalatestVersion % Test, - "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test + "org.graalvm.sdk" % "polyglot-tck" % graalMavenPackagesVersion % "provided", + "org.graalvm.truffle" % "truffle-api" % graalMavenPackagesVersion % "provided", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion, + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion, + "io.circe" %% "circe-yaml" % circeYamlVersion % "provided", // as required by `pkg` and `editions` + "com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion, + "org.scalatest" %% "scalatest" % scalatestVersion % Test, + "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ), - libraryDependencies ++= jackson, GenerateFlatbuffers.flatcVersion := flatbuffersVersion, Compile / sourceGenerators += GenerateFlatbuffers.task ) @@ -1477,6 +1474,17 @@ lazy val `polyglot-api` = project .dependsOn(`text-buffer`) .dependsOn(`logging-utils`) .dependsOn(testkit % Test) + .dependsOn(`polyglot-api-macros`) + +lazy val `polyglot-api-macros` = project + .in(file("engine/polyglot-api-macros")) + .settings( + frgaalJavaCompilerSetting, + libraryDependencies ++= Seq( + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion % "provided", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "provided" + ) + ) lazy val `language-server` = (project in file("engine/language-server")) .enablePlugins(JPMSPlugin) diff --git a/distribution/engine/THIRD-PARTY/NOTICE b/distribution/engine/THIRD-PARTY/NOTICE index 3bf6c34cac6..5ae8c550cef 100644 --- a/distribution/engine/THIRD-PARTY/NOTICE +++ b/distribution/engine/THIRD-PARTY/NOTICE @@ -46,14 +46,14 @@ The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.core.jackson-databind-2.15.2`. -'jackson-dataformat-cbor', licensed under the The Apache Software License, Version 2.0, is distributed with the engine. -The license file can be found at `licenses/APACHE2.0`. -Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2`. - - -'jackson-module-scala_2.13', licensed under the The Apache Software License, Version 2.0, is distributed with the engine. +'jsoniter-scala-core_2.13', licensed under the MIT License, is distributed with the engine. The license information can be found along with the copyright notices. -Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2`. +Copyright notices related to this dependency can be found in the directory `com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5`. + + +'jsoniter-scala-macros_2.13', licensed under the MIT License, is distributed with the engine. +The license information can be found along with the copyright notices. +Copyright notices related to this dependency can be found in the directory `com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5`. 'pureconfig-core_2.13', licensed under the Mozilla Public License, version 2.0, is distributed with the engine. @@ -106,11 +106,6 @@ The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `com.monovore.decline_2.13-2.4.1`. -'paranamer', licensed under the BSD, is distributed with the engine. -The license information can be found along with the copyright notices. -Copyright notices related to this dependency can be found in the directory `com.thoughtworks.paranamer.paranamer-2.8`. - - 'akka-actor-typed_2.13', licensed under the Apache-2.0, is distributed with the engine. The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-actor-typed_2.13-2.6.20`. diff --git a/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt b/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt deleted file mode 100644 index 71e1f423f69..00000000000 --- a/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt +++ /dev/null @@ -1,145 +0,0 @@ -Here are people who have contributed to the development of Jackson JSON processor -binary data formats module -(version numbers in brackets indicate release in which the problem was fixed) - -Tatu Saloranta (tatu.saloranta@iki.fi): author - --------------------------------------------------------------------------------- -Credits for individual projects, since 2.8.0 --------------------------------------------------------------------------------- - -Michael Zeng (shotbythought@github) - -* Contributed fix for #27: (protobuf) Fixed long deserialization problem for longs of ~13digit length - (2.8.2) -* Reported #58 (avro): Regression due to changed namespace of inner enum types - (2.8.8) - -Kenji Noguchi (knoguchi@github) - -* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field - (2.8.9) - -marsqing@github - -* Reported #85: (protobuf) _decode32Bits() bug in ProtobufParser - (2.8.9) -* Reported #94: (protobuf) Should _ensureRoom in ProtobufGenerator.writeString() - (2.8.10) -* Reported #106 (protobuf), contributed fix for: calling _skipUnknownValue() twice - (2.8.11 / 2.9.1) -* Reported #116 (protobuf), contributed fix for: Should skip the positive byte - which is the last byte of an varint - (2.9.3) -* Reported #126, contributed fix for: always call checkEnd() when skip unknown field - (2.8.11 / 2.9.3) - -baharclerode@github: - -* Contributed #14 (avro): Add support for Avro annotations via `AvroAnnotationIntrospector` - (2.9.0) -* Contributed #15 (avro): Add a way to produce "file" style Avro output - (2.9.0) -* Contributed #57 (avro): Add support for @Stringable annotation - (2.9.0) -* Contributed #59 (avro): Add support for @AvroAlias annotation for Record/Enum name evolution - (2.9.0) -* Contributed #60 (avro): Add support for `@Union` and polymorphic types - (2.9.0) - -Eldad Rudich (eldadru@github) - -* Reported #68 (proto): Getting "type not supported as root type by protobuf" for serialization - of short and UUID types - (2.9.0) - -philipa@github - -* Reported #114 (cbor), contributed fix for: copyStructure(): avoid duplicate tags - when copying tagged binary - (2.9.3) - -Jacek Lach (JacekLach@github) - -* Reported #124: Invalid value returned for negative int32 where the absolute value is > 2^31 - 1 - (2.9.3) - -Leo Wang (wanglingsong@github) - -* Reported #135: Infinite sequence of `END_OBJECT` tokens returned at end of streaming read - (2.9.6) - -Michael Milkin (mmilkin@github) -* Reported, Contributed fix for #142: (ion) `IonParser.getNumberType()` returns `null` - for `IonType.FLOAT` - (2.9.7) - -Guido Medina (guidomedina@github) -* Reported #153: (smile) Unable to set a compression input/output decorator to a `SmileFactory` - (2.9.8) - -Alexander Cyon (Sajjon@github) -* Reported #159: (cbor) Some short UTF Strings encoded using non-canonical form - (2.9.9) - -Łukasz Dziedziak (lukidzi@github) -* Reported, contributed fix for #161: (avro) Deserialize from newer version to older - one throws NullPointerException - (2.9.9) - -Carter Kozak (cakofony@github) -* Reported, suggested fix for #155: Inconsistent support for FLUSH_PASSED_TO_STREAM - (2.10.0) - -Fernando Raganhan Barbosa (raganhan@github) -* Suggested #163: (ion) Update `ion-java` dependency - (2.10.0) - -Juliana Amorim (amorimjuliana@github) -* Reported #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) - -Marcos Passos (marcospassos@github) -* Contributed fix for #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) -* Contributed fix for #173: (avro) Improve Union type serialization performance - (2.10.0) -* Contributed fix for #211: (avro) Fix schema evolution involving maps of non-scalar - (2.10.5) -* Contributed fix for #216: (avro) Avro null deserialization - (2.11.2) -* Contributed #219: Cache record names to avoid hitting class loader - (2.11.3) - -John (iziamos@github) -* Reported, suggested fix for #178: Fix issue wit input offsets when parsing CBOR from `InputStream` - (2.10.0) - -Paul Adolph (padolph@github) -* Reported #185: Internal parsing of tagged arrays can lead to stack overflow - (2.10.1) - -Yanming Zhou (quaff@github) -* Reported #188: Unexpected `MismatchedInputException` for `byte[]` value bound to `String` - in collection/array - (2.10.1) - -Zack Slayton (zslayton@github) -* Reported, contributed fix for #189: (ion) IonObjectMapper close()s the provided IonWriter unnecessarily - (2.10.2) - -Binh Tran (ankel@github) -* Reported, contributed fix for #192: (ion) Allow `IonObjectMapper` with class name annotation introspector - to deserialize generic subtypes - (2.11.0) - -Jonas Konrad (yawkat@github) -* Reported, contributed fix for #201: `CBORGenerator.Feature.WRITE_MINIMAL_INTS` does not write - most compact form for all integers - (2.11.0) - -Michael Liedtke (mcliedtke@github) - -* Contributed fix for #212: (ion) Optimize `IonParser.getNumberType()` using - `IonReader.getIntegerSize()` - (2.12.0) diff --git a/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE b/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE deleted file mode 100644 index 2011e317478..00000000000 --- a/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor Scala module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivative works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES b/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES deleted file mode 100644 index 2aba3b414bd..00000000000 --- a/distribution/engine/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich) diff --git a/distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE b/distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE new file mode 100644 index 00000000000..a33507599b4 --- /dev/null +++ b/distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Andriy Plokhotnyuk, and respective contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE b/distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE new file mode 100644 index 00000000000..a33507599b4 --- /dev/null +++ b/distribution/engine/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Andriy Plokhotnyuk, and respective contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/distribution/engine/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES b/distribution/engine/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES deleted file mode 100644 index 54a32ab99c7..00000000000 --- a/distribution/engine/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2007 Paul Hammant - * Copyright 2013 Samuel Halliday - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * - * Copyright (c) 2013 Stefan Fleiter - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*** - * - * Copyright (c) 2007 Paul Hammant - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*** - * - * Portions Copyright (c) 2007 Paul Hammant - * Portions copyright (c) 2000-2007 INRIA, France Telecom - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - diff --git a/distribution/project-manager/THIRD-PARTY/NOTICE b/distribution/project-manager/THIRD-PARTY/NOTICE index a02778150b4..6533aeb124e 100644 --- a/distribution/project-manager/THIRD-PARTY/NOTICE +++ b/distribution/project-manager/THIRD-PARTY/NOTICE @@ -51,14 +51,14 @@ The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.core.jackson-databind-2.15.2`. -'jackson-dataformat-cbor', licensed under the The Apache Software License, Version 2.0, is distributed with the project-manager. -The license file can be found at `licenses/APACHE2.0`. -Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2`. +'jsoniter-scala-core_2.13', licensed under the MIT License, is distributed with the project-manager. +The license information can be found along with the copyright notices. +Copyright notices related to this dependency can be found in the directory `com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5`. -'jackson-module-scala_2.13', licensed under the The Apache Software License, Version 2.0, is distributed with the project-manager. -The license file can be found at `licenses/APACHE2.0`. -Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2`. +'jsoniter-scala-macros_2.13', licensed under the MIT License, is distributed with the project-manager. +The license information can be found along with the copyright notices. +Copyright notices related to this dependency can be found in the directory `com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5`. 'pureconfig-core_2.13', licensed under the Mozilla Public License, version 2.0, is distributed with the project-manager. @@ -86,11 +86,6 @@ The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `com.google.flatbuffers.flatbuffers-java-24.3.25`. -'paranamer', licensed under the BSD, is distributed with the project-manager. -The license information can be found along with the copyright notices. -Copyright notices related to this dependency can be found in the directory `com.thoughtworks.paranamer.paranamer-2.8`. - - 'akka-actor-typed_2.13', licensed under the Apache-2.0, is distributed with the project-manager. The license file can be found at `licenses/APACHE2.0`. Copyright notices related to this dependency can be found in the directory `com.typesafe.akka.akka-actor-typed_2.13-2.6.20`. diff --git a/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt b/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt deleted file mode 100644 index 71e1f423f69..00000000000 --- a/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/CREDITS-2.x.txt +++ /dev/null @@ -1,145 +0,0 @@ -Here are people who have contributed to the development of Jackson JSON processor -binary data formats module -(version numbers in brackets indicate release in which the problem was fixed) - -Tatu Saloranta (tatu.saloranta@iki.fi): author - --------------------------------------------------------------------------------- -Credits for individual projects, since 2.8.0 --------------------------------------------------------------------------------- - -Michael Zeng (shotbythought@github) - -* Contributed fix for #27: (protobuf) Fixed long deserialization problem for longs of ~13digit length - (2.8.2) -* Reported #58 (avro): Regression due to changed namespace of inner enum types - (2.8.8) - -Kenji Noguchi (knoguchi@github) - -* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field - (2.8.9) - -marsqing@github - -* Reported #85: (protobuf) _decode32Bits() bug in ProtobufParser - (2.8.9) -* Reported #94: (protobuf) Should _ensureRoom in ProtobufGenerator.writeString() - (2.8.10) -* Reported #106 (protobuf), contributed fix for: calling _skipUnknownValue() twice - (2.8.11 / 2.9.1) -* Reported #116 (protobuf), contributed fix for: Should skip the positive byte - which is the last byte of an varint - (2.9.3) -* Reported #126, contributed fix for: always call checkEnd() when skip unknown field - (2.8.11 / 2.9.3) - -baharclerode@github: - -* Contributed #14 (avro): Add support for Avro annotations via `AvroAnnotationIntrospector` - (2.9.0) -* Contributed #15 (avro): Add a way to produce "file" style Avro output - (2.9.0) -* Contributed #57 (avro): Add support for @Stringable annotation - (2.9.0) -* Contributed #59 (avro): Add support for @AvroAlias annotation for Record/Enum name evolution - (2.9.0) -* Contributed #60 (avro): Add support for `@Union` and polymorphic types - (2.9.0) - -Eldad Rudich (eldadru@github) - -* Reported #68 (proto): Getting "type not supported as root type by protobuf" for serialization - of short and UUID types - (2.9.0) - -philipa@github - -* Reported #114 (cbor), contributed fix for: copyStructure(): avoid duplicate tags - when copying tagged binary - (2.9.3) - -Jacek Lach (JacekLach@github) - -* Reported #124: Invalid value returned for negative int32 where the absolute value is > 2^31 - 1 - (2.9.3) - -Leo Wang (wanglingsong@github) - -* Reported #135: Infinite sequence of `END_OBJECT` tokens returned at end of streaming read - (2.9.6) - -Michael Milkin (mmilkin@github) -* Reported, Contributed fix for #142: (ion) `IonParser.getNumberType()` returns `null` - for `IonType.FLOAT` - (2.9.7) - -Guido Medina (guidomedina@github) -* Reported #153: (smile) Unable to set a compression input/output decorator to a `SmileFactory` - (2.9.8) - -Alexander Cyon (Sajjon@github) -* Reported #159: (cbor) Some short UTF Strings encoded using non-canonical form - (2.9.9) - -Łukasz Dziedziak (lukidzi@github) -* Reported, contributed fix for #161: (avro) Deserialize from newer version to older - one throws NullPointerException - (2.9.9) - -Carter Kozak (cakofony@github) -* Reported, suggested fix for #155: Inconsistent support for FLUSH_PASSED_TO_STREAM - (2.10.0) - -Fernando Raganhan Barbosa (raganhan@github) -* Suggested #163: (ion) Update `ion-java` dependency - (2.10.0) - -Juliana Amorim (amorimjuliana@github) -* Reported #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) - -Marcos Passos (marcospassos@github) -* Contributed fix for #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) -* Contributed fix for #173: (avro) Improve Union type serialization performance - (2.10.0) -* Contributed fix for #211: (avro) Fix schema evolution involving maps of non-scalar - (2.10.5) -* Contributed fix for #216: (avro) Avro null deserialization - (2.11.2) -* Contributed #219: Cache record names to avoid hitting class loader - (2.11.3) - -John (iziamos@github) -* Reported, suggested fix for #178: Fix issue wit input offsets when parsing CBOR from `InputStream` - (2.10.0) - -Paul Adolph (padolph@github) -* Reported #185: Internal parsing of tagged arrays can lead to stack overflow - (2.10.1) - -Yanming Zhou (quaff@github) -* Reported #188: Unexpected `MismatchedInputException` for `byte[]` value bound to `String` - in collection/array - (2.10.1) - -Zack Slayton (zslayton@github) -* Reported, contributed fix for #189: (ion) IonObjectMapper close()s the provided IonWriter unnecessarily - (2.10.2) - -Binh Tran (ankel@github) -* Reported, contributed fix for #192: (ion) Allow `IonObjectMapper` with class name annotation introspector - to deserialize generic subtypes - (2.11.0) - -Jonas Konrad (yawkat@github) -* Reported, contributed fix for #201: `CBORGenerator.Feature.WRITE_MINIMAL_INTS` does not write - most compact form for all integers - (2.11.0) - -Michael Liedtke (mcliedtke@github) - -* Contributed fix for #212: (ion) Optimize `IonParser.getNumberType()` using - `IonReader.getIntegerSize()` - (2.12.0) diff --git a/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE b/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE deleted file mode 100644 index 2011e317478..00000000000 --- a/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor Scala module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivative works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES b/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES deleted file mode 100644 index afd6f5786e9..00000000000 --- a/distribution/project-manager/THIRD-PARTY/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/NOTICES +++ /dev/null @@ -1,29 +0,0 @@ ------------------------- - -From file com/fasterxml/jackson/module/scala/introspect/BeanIntrospector.scala: - -/* - * Derived from source code of scalabeans: - * https://raw.github.com/scalastuff/scalabeans/62b50c4e2482cbc1f494e0ac5c6c54fadc1bbcdd/src/main/scala/org/scalastuff/scalabeans/BeanIntrospector.scala - * - * The scalabeans code is covered by the copyright statement that follows. - */ - -/* - * Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - ------------------------- - diff --git a/distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE b/distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE new file mode 100644 index 00000000000..a33507599b4 --- /dev/null +++ b/distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Andriy Plokhotnyuk, and respective contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE b/distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE new file mode 100644 index 00000000000..a33507599b4 --- /dev/null +++ b/distribution/project-manager/THIRD-PARTY/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Andriy Plokhotnyuk, and respective contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/distribution/project-manager/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES b/distribution/project-manager/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES deleted file mode 100644 index 54a32ab99c7..00000000000 --- a/distribution/project-manager/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2007 Paul Hammant - * Copyright 2013 Samuel Halliday - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * - * Copyright (c) 2013 Stefan Fleiter - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*** - * - * Copyright (c) 2007 Paul Hammant - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*** - * - * Portions Copyright (c) 2007 Paul Hammant - * Portions copyright (c) 2000-2007 INRIA, France Telecom - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - diff --git a/engine/language-server/src/main/scala/org/enso/languageserver/runtime/RuntimeConnector.scala b/engine/language-server/src/main/scala/org/enso/languageserver/runtime/RuntimeConnector.scala index 5e355252d95..8c0fc7b872d 100644 --- a/engine/language-server/src/main/scala/org/enso/languageserver/runtime/RuntimeConnector.scala +++ b/engine/language-server/src/main/scala/org/enso/languageserver/runtime/RuntimeConnector.scala @@ -13,10 +13,10 @@ import org.enso.logger.akka.ActorMessageLogging import org.enso.logger.masking.ToLogString import org.enso.polyglot.runtime.Runtime import org.enso.polyglot.runtime.Runtime.{Api, ApiEnvelope} +import org.enso.polyglot.runtime.serde.ApiSerde import org.graalvm.polyglot.io.MessageEndpoint import java.nio.ByteBuffer - import scala.util.{Failure, Success} /** An actor managing a connection to Enso's runtime server. */ @@ -90,7 +90,7 @@ final class RuntimeConnector( context.stop(self) case msg: Runtime.ApiEnvelope => - engine.sendBinary(Runtime.Api.serialize(msg)) + engine.sendBinary(ApiSerde.serialize(msg)) msg match { case Api.Request(Some(id), _) => @@ -178,7 +178,7 @@ object RuntimeConnector { override def sendText(text: String): Unit = {} override def sendBinary(data: ByteBuffer): Unit = - Runtime.Api.deserializeApiEnvelope(data) match { + ApiSerde.deserializeApiEnvelope(data) match { case Success(msg) => actor ! MessageFromRuntime(msg) case Failure(ex) => diff --git a/engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala b/engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala new file mode 100644 index 00000000000..fbbfde01a47 --- /dev/null +++ b/engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala @@ -0,0 +1,46 @@ +package org.enso.polyglot.macros + +import com.github.plokhotnyuk.jsoniter_scala.macros.CodecMakerConfig +import com.github.plokhotnyuk.jsoniter_scala.core.{ + JsonReader, + JsonValueCodec, + JsonWriter +} + +import java.io.File +object SerdeConfig { + + /** Custom configuration for generating jsoniter's codecs. + * + * API data structures are recursive and have to be allowed explicitly. + * `skipNestedOptionValues` has to be enabled to workaround an apparent + * problem with nested option values present next to a single level option + * values (reported under https://github.com/plokhotnyuk/jsoniter-scala/issues/1146). + */ + val config = CodecMakerConfig + .withAllowRecursiveTypes(allowRecursiveTypes = true) + .withRequireCollectionFields(requireCollectionFields = true) + .withTransientEmpty(false) + .withSkipNestedOptionValues(true) + + implicit val fileCodec: JsonValueCodec[File] = new JsonValueCodec[File] { + override def decodeValue(in: JsonReader, default: File): File = { + val t = in.nextToken() + + if (t == 'n') in.readNullOrError(null, "expected 'null' or JSON value") + else { + in.rollbackToken() + val path = in.readString(null) + new File(path) + } + } + + override def encodeValue(x: File, out: JsonWriter): Unit = { + if (x == null) out.writeNull() + else out.writeVal(x.getPath) + } + + override def nullValue: File = null + } + +} diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/DocSection.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/DocSection.scala index 078e8f38847..5bc5a912959 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/DocSection.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/DocSection.scala @@ -1,29 +1,8 @@ package org.enso.polyglot -import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo} +import com.github.plokhotnyuk.jsoniter_scala.macros.named /** The base trait for the documentation section. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[DocSection.Tag], - name = "docsectionTag" - ), - new JsonSubTypes.Type( - value = classOf[DocSection.Paragraph], - name = "docsectionParagraph" - ), - new JsonSubTypes.Type( - value = classOf[DocSection.Keyed], - name = "docsectionKeyed" - ), - new JsonSubTypes.Type( - value = classOf[DocSection.Marked], - name = "docsectionMarked" - ) - ) -) sealed trait DocSection object DocSection { @@ -44,6 +23,7 @@ object DocSection { * @param name the tag name * @param body the tag text */ + @named("docsecionTag") case class Tag(name: String, body: String) extends DocSection /** The paragraph of the text. @@ -58,6 +38,7 @@ object DocSection { * * @param body the elements that make up this paragraph */ + @named("docsecionParagraph") case class Paragraph(body: String) extends DocSection /** The section that starts with the key followed by the colon and the body. @@ -81,6 +62,7 @@ object DocSection { * @param key the section key * @param body the elements the make up the body of the section */ + @named("docsecionKeyed") case class Keyed(key: String, body: String) extends DocSection /** The section that starts with the mark followed by the header and the body. @@ -107,27 +89,11 @@ object DocSection { * @param header the section header * @param body the elements that make up the body of the section */ + @named("docsecionMarked") case class Marked(mark: Mark, header: Option[String], body: String) extends DocSection /** The base trait for the section marks. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Mark.Important], - name = "docsectionMarkImportant" - ), - new JsonSubTypes.Type( - value = classOf[Mark.Info], - name = "docsectionMarkInfo" - ), - new JsonSubTypes.Type( - value = classOf[Mark.Example], - name = "docsectionMarkExample" - ) - ) - ) sealed trait Mark object Mark { case class Important() extends Mark diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/ExportedSymbol.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/ExportedSymbol.scala index 243ccdb9858..877b2474d05 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/ExportedSymbol.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/ExportedSymbol.scala @@ -1,28 +1,7 @@ package org.enso.polyglot -import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo} +import com.github.plokhotnyuk.jsoniter_scala.macros.named -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[ExportedSymbol.Module], - name = "exportedModule" - ), - new JsonSubTypes.Type( - value = classOf[ExportedSymbol.Type], - name = "exportedType" - ), - new JsonSubTypes.Type( - value = classOf[ExportedSymbol.Constructor], - name = "exportedConstructor" - ), - new JsonSubTypes.Type( - value = classOf[ExportedSymbol.Method], - name = "exportedMethod" - ) - ) -) sealed trait ExportedSymbol { def module: String @@ -59,6 +38,7 @@ object ExportedSymbol { * * @param module the module name */ + @named("exportedModule") case class Module(module: String) extends ExportedSymbol { /** @inheritdoc */ @@ -75,6 +55,7 @@ object ExportedSymbol { * @param module the module defining this atom * @param name the type name */ + @named("exportedType") case class Type(module: String, name: String) extends ExportedSymbol { /** @inheritdoc */ @@ -87,6 +68,7 @@ object ExportedSymbol { * @param module the module where this constructor is defined * @param name the constructor name */ + @named("exportedConstructor") case class Constructor(module: String, name: String) extends ExportedSymbol { /** @inheritdoc */ @@ -99,6 +81,7 @@ object ExportedSymbol { * @param module the module defining this method * @param name the method name */ + @named("exportedMethod") case class Method(module: String, name: String) extends ExportedSymbol { /** @inheritdoc */ diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala index 580ff093cb2..2bf0862441d 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/Suggestion.scala @@ -1,6 +1,6 @@ package org.enso.polyglot -import com.fasterxml.jackson.annotation.{JsonIgnore, JsonSubTypes, JsonTypeInfo} +import com.github.plokhotnyuk.jsoniter_scala.macros.named import org.enso.logger.masking.ToLogString import java.util.UUID @@ -8,43 +8,6 @@ import java.util.UUID import scala.collection.immutable.ListSet /** A search suggestion. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Suggestion.Module], - name = "suggestionModule" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Type], - name = "suggestionType" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Constructor], - name = "suggestionConstructor" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Getter], - name = "suggestionGetter" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.DefinedMethod], - name = "suggestionDefinedMethod" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Conversion], - name = "suggestionConversion" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Function], - name = "suggestionFunction" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Local], - name = "suggestionLocal" - ) - ) -) sealed trait Suggestion extends ToLogString { def externalId: Option[Suggestion.ExternalID] @@ -243,6 +206,7 @@ object Suggestion { * @param documentation the documentation string * @param reexports modules re-exporting this module */ + @named("suggestionModule") case class Module( module: String, documentation: Option[String], @@ -295,6 +259,7 @@ object Suggestion { * @param documentation the documentation string * @param reexports modules re-exporting this atom */ + @named("suggestionType") case class Type( externalId: Option[ExternalID], module: String, @@ -355,6 +320,7 @@ object Suggestion { * @param annotations the list of annotations * @param reexports modules re-exporting this atom */ + @named("suggestionConstructor") case class Constructor( externalId: Option[ExternalID], module: String, @@ -404,23 +370,6 @@ object Suggestion { } /** Base trait for method suggestions. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Suggestion.Getter], - name = "suggestionMethodGetter" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.DefinedMethod], - name = "suggestionMethodDefinedMethod" - ), - new JsonSubTypes.Type( - value = classOf[Suggestion.Conversion], - name = "suggestionMethodConversion" - ) - ) - ) sealed trait Method extends Suggestion { def arguments: Seq[Argument] def selfType: String @@ -441,6 +390,7 @@ object Suggestion { * @param annotations the list of annotations * @param reexports modules re-exporting this method */ + @named("suggestionMethodGetter") case class Getter( externalId: Option[ExternalID], module: String, @@ -455,7 +405,6 @@ object Suggestion { with ToLogString { /** @inheritdoc */ - @JsonIgnore override def isStatic: Boolean = false override def withReexports(reexports: Set[String]): Suggestion = @@ -507,6 +456,7 @@ object Suggestion { * @param annotations the list of annotations * @param reexports modules re-exporting this method */ + @named("suggestionMethodDefinedMethod") case class DefinedMethod( externalId: Option[ExternalID], module: String, @@ -568,6 +518,7 @@ object Suggestion { * @param documentation the documentation string * @param reexports modules re-exporting this conversion */ + @named("suggestionMethodConversion") case class Conversion( externalId: Option[ExternalID], module: String, @@ -579,15 +530,12 @@ object Suggestion { ) extends Method { /** @inheritdoc */ - @JsonIgnore override def isStatic: Boolean = false /** @inheritdoc */ - @JsonIgnore override def annotations: Seq[String] = Seq() /** @inheritdoc */ - @JsonIgnore override def name: String = Kind.Conversion.From @@ -636,6 +584,7 @@ object Suggestion { * @param scope the scope where the function is defined * @param documentation the documentation string */ + @named("suggestionFunction") case class Function( externalId: Option[ExternalID], module: String, @@ -693,6 +642,7 @@ object Suggestion { * @param scope the scope where the value is defined * @param documentation the documentation string */ + @named("suggestionLocal") case class Local( externalId: Option[ExternalID], module: String, diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/These.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/These.scala index 41dd17edc97..43358f994f3 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/These.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/These.scala @@ -1,54 +1,25 @@ package org.enso.polyglot.data -import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo} + +import com.github.plokhotnyuk.jsoniter_scala.macros.named /** An either-or-both data type. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[These.Here[_]], - name = "theseHere" - ), - new JsonSubTypes.Type( - value = classOf[These.There[_]], - name = "theseThere" - ), - new JsonSubTypes.Type( - value = classOf[These.Both[_, _]], - name = "theseBoth" - ) - ) -) sealed trait These[+A, +B] object These { + @named("theseHere") case class Here[+A]( - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY - ) here: A ) extends These[A, Nothing] + @named("theseThere") case class There[+B]( - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY - ) there: B ) extends These[Nothing, B] + @named("theseBoth") case class Both[+A, +B]( - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY - ) here: A, - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY - ) there: B ) extends These[A, B] } diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/Tree.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/Tree.scala index 09f589bacec..1b17be75bf7 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/Tree.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/Tree.scala @@ -1,28 +1,12 @@ package org.enso.polyglot.data -import com.fasterxml.jackson.annotation.{JsonIgnore, JsonSubTypes, JsonTypeInfo} + +import com.github.plokhotnyuk.jsoniter_scala.macros.named import scala.collection.mutable /** A rose-tree like data structure that distinguishes between root and node * elements. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.EXTERNAL_PROPERTY, - property = "type" -) -@JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Tree.Root[_]], - name = "treeRoot" - ), - new JsonSubTypes.Type( - value = classOf[Tree.Node[_]], - name = "treeNode" - ) - ) -) sealed trait Tree[+A] { /** Build a new tree by applying a function to all elements of this tree. @@ -30,7 +14,6 @@ sealed trait Tree[+A] { * @param f the function to apply to each element * @return the new tree after applying the function `f` to elements */ - @JsonIgnore final def map[B](f: A => B): Tree[B] = Tree.map(this)(f) @@ -40,7 +23,6 @@ sealed trait Tree[+A] { * @param f the partial function to apply * @return the result of running `f` on the first element it's defined for. */ - @JsonIgnore final def collectFirst[B](f: PartialFunction[A, B]): Option[B] = Tree.collectFirst(this)(f) @@ -50,7 +32,6 @@ sealed trait Tree[+A] { * @return a new tree consisting of all elements of this tree that satisfy * the given predicate p. */ - @JsonIgnore final def filter(p: A => Boolean): Tree[A] = Tree.filter(this)(p) @@ -61,7 +42,6 @@ sealed trait Tree[+A] { * @return the result of applying the fold operator f between all the * elements and `acc` */ - @JsonIgnore final def fold[B](acc: B)(f: (B, A) => B): B = Tree.fold(this, acc)(f) @@ -70,7 +50,6 @@ sealed trait Tree[+A] { * @param that the tree to join with * @return the result of joining this and that trees */ - @JsonIgnore final def zip[B](that: Tree[B]): Tree[These[A, B]] = Tree.zip(this, that) @@ -87,41 +66,32 @@ sealed trait Tree[+A] { * @param p the predicate comparing the elements * @return the result of joining this and that trees */ - @JsonIgnore final def zipBy[B](that: Tree[B])(p: (A, B) => Boolean): Tree[These[A, B]] = Tree.zipBy(this, that)(p) /** Check whether the tree is empty. */ - @JsonIgnore final def isEmpty: Boolean = Tree.isEmpty(this) /** Check whether the tree is not empty. */ - @JsonIgnore final def nonEmpty: Boolean = !isEmpty /** Convert tree to vector. */ - @JsonIgnore final def toVector: Vector[A] = Tree.toVector(this) } object Tree { + @named("treeRoot") case class Root[+A]( - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME - ) children: Vector[Node[A]] ) extends Tree[A] + @named("treeNode") case class Node[+A]( - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME) element: A, - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME - ) children: Vector[Node[A]] ) extends Tree[A] diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/TypeGraph.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/TypeGraph.scala index 5d2dda48885..bc48dd3c136 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/TypeGraph.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/data/TypeGraph.scala @@ -1,7 +1,5 @@ package org.enso.polyglot.data -import com.fasterxml.jackson.annotation.JsonIgnore - import scala.collection.mutable /** A collection that represents subsumption relationships between types. @@ -30,7 +28,6 @@ case class TypeGraph( * * @param name the fully-qualified typename */ - @JsonIgnore def insertWithoutParent(name: String): Unit = { parentLinks.update(name, Set()) } @@ -40,7 +37,6 @@ case class TypeGraph( * @param typeName the fully-qualified name of the type to set the parent for * @param parentName the fully-qualified name of the parent of `typeName` */ - @JsonIgnore def insert(typeName: String, parentName: String): Unit = { parentLinks.updateWith(typeName) { case Some(parents) => Some(parents + parentName) @@ -57,7 +53,6 @@ case class TypeGraph( * parents for * @return the set of direct parents for `typeName` */ - @JsonIgnore def getDirectParents(typeName: String): Set[String] = { parentLinks.getOrElse(typeName, Set(defaultRootType)) } @@ -70,7 +65,6 @@ case class TypeGraph( * @param typeName the fully-qualified type name for which to get the parents * @return all parents of `typeName`, ordered by specificity */ - @JsonIgnore def getParents(typeName: String): List[String] = { var seenNodes: Set[String] = Set() diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala index 58179ddc1e8..3f37299bf58 100644 --- a/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/Runtime.scala @@ -1,17 +1,6 @@ package org.enso.polyglot.runtime -import com.fasterxml.jackson.annotation.{ - JsonIgnoreProperties, - JsonSubTypes, - JsonTypeInfo -} -import com.fasterxml.jackson.module.scala.deser.ScalaObjectDeserializerModule -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.dataformat.cbor.CBORFactory -import com.fasterxml.jackson.module.scala.{ - ClassTagExtensions, - DefaultScalaModule -} +import com.github.plokhotnyuk.jsoniter_scala.macros.named import org.enso.editions.LibraryName import org.enso.logger.masking.{MaskedPath, MaskedString, ToLogString} import org.enso.pkg.{ComponentGroups, QualifiedName} @@ -21,307 +10,12 @@ import org.enso.text.editing.model import org.enso.text.editing.model.{Range, TextEdit} import java.io.File -import java.nio.ByteBuffer import java.util.UUID -import scala.util.Try object Runtime { /** A common supertype for all Runtime API methods. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Api.Request], - name = "request" - ), - new JsonSubTypes.Type( - value = classOf[Api.Response], - name = "response" - ), - new JsonSubTypes.Type( - value = classOf[Api.CreateContextRequest], - name = "createContextRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.CreateContextResponse], - name = "createContextResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.DestroyContextRequest], - name = "destroyContextRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.DestroyContextResponse], - name = "destroyContextResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.PushContextRequest], - name = "pushContextRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.PushContextResponse], - name = "pushContextResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.PopContextRequest], - name = "popContextRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.PopContextResponse], - name = "popContextResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.RecomputeContextRequest], - name = "recomputeContextRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.RecomputeContextResponse], - name = "recomputeContextResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.InterruptContextRequest], - name = "interruptContextRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.InterruptContextResponse], - name = "interruptContextResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.GetComponentGroupsRequest], - name = "getComponentGroupsRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.GetComponentGroupsResponse], - name = "getComponentGroupsResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.OpenFileRequest], - name = "setModuleSourcesNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.OpenFileResponse.type], - name = "moduleSourcesSetNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.EditFileNotification], - name = "editFileNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.SetExpressionValueNotification], - name = "setExpressionValueNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.CloseFileNotification], - name = "closeFileNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationUpdate], - name = "visualizationUpdate" - ), - new JsonSubTypes.Type( - value = classOf[Api.FileEdit], - name = "fileEdit" - ), - new JsonSubTypes.Type( - value = classOf[Api.AttachVisualization], - name = "attachVisualization" - ), - new JsonSubTypes.Type( - value = classOf[Api.ExecuteExpression], - name = "executeExpression" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationAttached], - name = "visualizationAttached" - ), - new JsonSubTypes.Type( - value = classOf[Api.DetachVisualization], - name = "detachVisualization" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationDetached], - name = "visualizationDetached" - ), - new JsonSubTypes.Type( - value = classOf[Api.ModifyVisualization], - name = "modifyVisualization" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationModified], - name = "visualizationModified" - ), - new JsonSubTypes.Type( - value = classOf[Api.ExpressionUpdates], - name = "expressionUpdates" - ), - new JsonSubTypes.Type( - value = classOf[Api.RenameProject], - name = "renameProject" - ), - new JsonSubTypes.Type( - value = classOf[Api.ProjectRenamed], - name = "projectRenamed" - ), - new JsonSubTypes.Type( - value = classOf[Api.ProjectRenameFailed], - name = "projectRenameFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.RenameSymbol], - name = "renameSymbol" - ), - new JsonSubTypes.Type( - value = classOf[Api.SymbolRenamed], - name = "symbolRenamed" - ), - new JsonSubTypes.Type( - value = classOf[Api.SymbolRenameFailed], - name = "symbolRenameFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.ContextNotExistError], - name = "contextNotExistError" - ), - new JsonSubTypes.Type( - value = classOf[Api.EmptyStackError], - name = "emptyStackError" - ), - new JsonSubTypes.Type( - value = classOf[Api.ModuleNotFound], - name = "moduleNotFound" - ), - new JsonSubTypes.Type( - value = classOf[Api.ExecutionUpdate], - name = "executionUpdate" - ), - new JsonSubTypes.Type( - value = classOf[Api.ExecutionFailed], - name = "executionFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.ExecutionComplete], - name = "executionSuccessful" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationExpressionFailed], - name = "visualizationExpressionFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationEvaluationFailed], - name = "visualizationEvaluationFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.VisualizationNotFound], - name = "visualizationNotFound" - ), - new JsonSubTypes.Type( - value = classOf[Api.InvalidStackItemError], - name = "invalidStackItemError" - ), - new JsonSubTypes.Type( - value = classOf[Api.InitializedNotification], - name = "initializedNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.ShutDownRuntimeServer], - name = "shutDownRuntimeServer" - ), - new JsonSubTypes.Type( - value = classOf[Api.RuntimeServerShutDown], - name = "runtimeServerShutDown" - ), - new JsonSubTypes.Type( - value = classOf[Api.SuggestionsDatabaseModuleUpdateNotification], - name = "suggestionsDatabaseModuleUpdateNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.SuggestionsDatabaseSuggestionsLoadedNotification], - name = "suggestionsDatabaseSuggestionsLoadedNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.AnalyzeModuleInScopeJobFinished], - name = "analyzeModuleInScopeJobFinished" - ), - new JsonSubTypes.Type( - value = classOf[Api.InvalidateModulesIndexRequest], - name = "invalidateModulesIndexRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.InvalidateModulesIndexResponse], - name = "invalidateModulesIndexResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.GetTypeGraphRequest], - name = "getTypeGraphRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.GetTypeGraphResponse], - name = "getTypeGraphResponse" - ), - new JsonSubTypes.Type( - value = classOf[Api.LibraryLoaded], - name = "libraryLoaded" - ), - new JsonSubTypes.Type( - value = classOf[Api.ProgressNotification], - name = "progressNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.AcquireLockRequest], - name = "acquireLockRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.ReleaseLockRequest], - name = "releaseLockRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.LockAcquired], - name = "lockAcquired" - ), - new JsonSubTypes.Type( - value = classOf[Api.CannotAcquireImmediately], - name = "cannotAcquireImmediately" - ), - new JsonSubTypes.Type( - value = classOf[Api.LockAcquireFailed], - name = "lockAcquireFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.LockReleased], - name = "lockReleased" - ), - new JsonSubTypes.Type( - value = classOf[Api.LockReleaseFailed], - name = "lockReleaseFailed" - ), - new JsonSubTypes.Type( - value = classOf[Api.DeserializeLibrarySuggestions], - name = "deserializeLibrarySuggestions" - ), - new JsonSubTypes.Type( - value = classOf[Api.StartBackgroundProcessing], - name = "startBackgroundProcessing" - ), - new JsonSubTypes.Type( - value = classOf[Api.BackgroundJobsStartedNotification], - name = "backgroundJobsStartedNotification" - ), - new JsonSubTypes.Type( - value = classOf[Api.SerializeModule], - name = "serializeModule" - ), - new JsonSubTypes.Type( - value = classOf[Api.SetExecutionEnvironmentRequest], - name = "setExecutionEnvironmentRequest" - ), - new JsonSubTypes.Type( - value = classOf[Api.SetExecutionEnvironmentResponse], - name = "setExecutionEnvironmentResponse" - ) - ) - ) sealed trait Api sealed trait ApiEnvelope extends Api sealed trait ApiRequest extends Api @@ -381,24 +75,12 @@ object Runtime { /** A representation of an executable position in code. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[StackItem.ExplicitCall], - name = "explicitCall" - ), - new JsonSubTypes.Type( - value = classOf[StackItem.LocalCall], - name = "localCall" - ) - ) - ) sealed trait StackItem object StackItem { /** A call performed at the top of the stack, to initialize the context. */ + @named("explicitCall") case class ExplicitCall( methodPointer: MethodPointer, thisArgumentExpression: Option[String], @@ -419,6 +101,7 @@ object Runtime { } /** A call corresponding to "entering a function call". */ + @named("localCall") case class LocalCall(expressionId: ExpressionId) extends StackItem } @@ -435,6 +118,7 @@ object Runtime { * has changed from the one that was cached, if any * @param payload an extra information about the computed value */ + @named("expressionUpdate") case class ExpressionUpdate( expressionId: ExpressionId, expressionType: Option[String], @@ -447,27 +131,6 @@ object Runtime { object ExpressionUpdate { /** Base trait for expression payloads. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Payload.Value], - name = "expressionUpdatePayloadValue" - ), - new JsonSubTypes.Type( - value = classOf[Payload.DataflowError], - name = "expressionUpdatePayloadDataflowError" - ), - new JsonSubTypes.Type( - value = classOf[Payload.Panic], - name = "expressionUpdatePayloadPanic" - ), - new JsonSubTypes.Type( - value = classOf[Payload.Pending], - name = "expressionUpdatePayloadPending" - ) - ) - ) sealed trait Payload object Payload { @@ -476,6 +139,7 @@ object Runtime { * @param warnings information about attached warnings. * @param functionSchema if the value represents a function, the function schema of that function, empty option otherwise */ + @named("expressionUpdatePayloadValue") case class Value( warnings: Option[Value.Warnings] = None, functionSchema: Option[FunctionSchema] = None @@ -498,6 +162,7 @@ object Runtime { /** TBD */ + @named("expressionUpdatePayloadPending") case class Pending(message: Option[String], progress: Option[Double]) extends Payload; @@ -505,6 +170,7 @@ object Runtime { * * @param trace the list of expressions leading to the root error. */ + @named("expressionUpdatePayloadDataflowError") case class DataflowError(trace: Seq[ExpressionId]) extends Payload /** Indicates that the expression failed with the runtime exception. @@ -512,6 +178,7 @@ object Runtime { * @param message the error message * @param trace the stack trace */ + @named("expressionUpdatePayloadPanic") case class Panic( message: String, trace: Seq[ExpressionId] @@ -529,15 +196,6 @@ object Runtime { /** An object representing profiling information about an executed * expression. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[ProfilingInfo.ExecutionTime], - name = "executionTime" - ) - ) - ) sealed trait ProfilingInfo object ProfilingInfo { @@ -545,35 +203,25 @@ object Runtime { * * @param nanoTime the time elapsed during execution in nanoseconds */ + @named("executionTime") case class ExecutionTime(nanoTime: Long) extends ProfilingInfo } /** An object representing invalidated expressions selector. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[InvalidatedExpressions.All], - name = "all" - ), - new JsonSubTypes.Type( - value = classOf[InvalidatedExpressions.Expressions], - name = "expressions" - ) - ) - ) sealed trait InvalidatedExpressions object InvalidatedExpressions { /** An object representing invalidation of all expressions. */ + @named("all") case class All() extends InvalidatedExpressions /** An object representing invalidation of a list of expressions. * * @param value a list of expressions to invalidate. */ + @named("expressions") case class Expressions(value: Vector[ExpressionId]) extends InvalidatedExpressions } @@ -583,6 +231,7 @@ object Runtime { * @param contextId the context's id. * @param updates a list of updates. */ + @named("expressionUpdates") final case class ExpressionUpdates( contextId: ContextId, updates: Set[ExpressionUpdate] @@ -594,6 +243,7 @@ object Runtime { * @param contextId a context identifier * @param expressionId an expression identifier */ + @named("visualizationContext") case class VisualizationContext( visualizationId: VisualizationId, contextId: ContextId, @@ -601,19 +251,6 @@ object Runtime { ) /** A visualization expression. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[VisualizationExpression.Text], - name = "visualizationExpressionText" - ), - new JsonSubTypes.Type( - value = classOf[VisualizationExpression.ModuleMethod], - name = "visualizationExpressionModuleMethod" - ) - ) - ) sealed trait VisualizationExpression extends ToLogString { def module: String def positionalArgumentsExpressions: Vector[String] @@ -627,6 +264,7 @@ object Runtime { * @param positionalArgumentsExpressions the list of arguments that will * be passed to the method */ + @named("visualizationExpressionText") case class Text( module: String, expression: String, @@ -650,6 +288,7 @@ object Runtime { * @param positionalArgumentsExpressions the list of arguments that will * be passed to the method */ + @named("visualizationExpressionModuleMethod") case class ModuleMethod( methodPointer: MethodPointer, positionalArgumentsExpressions: Vector[String] @@ -689,23 +328,6 @@ object Runtime { } /** An operation applied to the suggestion argument. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[SuggestionArgumentAction.Add], - name = "suggestionArgumentActionAdd" - ), - new JsonSubTypes.Type( - value = classOf[SuggestionArgumentAction.Remove], - name = "suggestionArgumentActionRemove" - ), - new JsonSubTypes.Type( - value = classOf[SuggestionArgumentAction.Modify], - name = "suggestionArgumentActionModify" - ) - ) - ) sealed trait SuggestionArgumentAction extends ToLogString object SuggestionArgumentAction { @@ -714,6 +336,7 @@ object Runtime { * @param index the position of the argument * @param argument the argument to add */ + @named("suggestionArgumentActionAdd") case class Add(index: Int, argument: Suggestion.Argument) extends SuggestionArgumentAction { @@ -729,6 +352,7 @@ object Runtime { * * @param index the position of the arugment */ + @named("suggestionArgumentActionRemove") case class Remove(index: Int) extends SuggestionArgumentAction { /** @inheritdoc */ @@ -745,6 +369,7 @@ object Runtime { * @param hasDefault the default flag to update * @param defaultValue the default value to update */ + @named("suggestionArgumentActionModify") case class Modify( index: Int, name: Option[String] = None, @@ -768,27 +393,11 @@ object Runtime { } /** An operation applied to the update */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[SuggestionAction.Add], - name = "suggestionActionAdd" - ), - new JsonSubTypes.Type( - value = classOf[SuggestionAction.Remove], - name = "suggestionActionRemove" - ), - new JsonSubTypes.Type( - value = classOf[SuggestionAction.Modify], - name = "suggestionActionModify" - ) - ) - ) sealed trait SuggestionAction extends ToLogString object SuggestionAction { /** Add the suggestion. */ + @named("suggestionActionAdd") case class Add() extends SuggestionAction { /** @inheritdoc */ @@ -797,6 +406,7 @@ object Runtime { } /** Remove the suggestion. */ + @named("suggestionActionRemove") case class Remove() extends SuggestionAction { /** @inheritdoc */ @@ -813,6 +423,7 @@ object Runtime { * @param scope the scope to update * @param reexport the reexport field to update */ + @named("suggestionActionModify") case class Modify( externalId: Option[Option[Suggestion.ExternalID]] = None, arguments: Option[Seq[SuggestionArgumentAction]] = None, @@ -839,15 +450,6 @@ object Runtime { } /** An action to apply to the suggestions database. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[SuggestionsDatabaseAction.Clean], - name = "suggestionsDatabaseActionClean" - ) - ) - ) sealed trait SuggestionsDatabaseAction object SuggestionsDatabaseAction { @@ -855,6 +457,7 @@ object Runtime { * * @param module the module name */ + @named("suggestionDatabaseActionClean") case class Clean(module: String) extends SuggestionsDatabaseAction } @@ -863,22 +466,11 @@ object Runtime { action: ExportsAction ) - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[ExportsAction.Add], - name = "exportsActionAdd" - ), - new JsonSubTypes.Type( - value = classOf[ExportsAction.Remove], - name = "exportsActionRemove" - ) - ) - ) sealed trait ExportsAction object ExportsAction { - case class Add() extends ExportsAction + @named("exportsActionAdd") + case class Add() extends ExportsAction + @named("exportsActionRemove") case class Remove() extends ExportsAction } @@ -899,23 +491,13 @@ object Runtime { s",action=${action.toLogString(shouldMask)})" } - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[DiagnosticType.Error.type], - name = "diagnosticTypeError" - ), - new JsonSubTypes.Type( - value = classOf[DiagnosticType.Warning.type], - name = "diagnosticTypeWarning" - ) - ) - ) sealed trait DiagnosticType object DiagnosticType { - case object Error extends DiagnosticType + @named("diagnosticTypeError") + case object Error extends DiagnosticType + + @named("diagnosticTypeWarning") case object Warning extends DiagnosticType } @@ -943,20 +525,6 @@ object Runtime { ")" } - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[ExecutionResult.Diagnostic], - name = "executionOutcomeDiagnostic" - ), - new JsonSubTypes.Type( - value = classOf[ExecutionResult.Failure], - name = "executionOutcomeFailure" - ) - ) - ) - @JsonIgnoreProperties(Array("error", "failure")) sealed trait ExecutionResult extends ToLogString { /** Checks if this result represents a critical failure. * */ @@ -977,6 +545,7 @@ object Runtime { * @param expressionId the id of related expression * @param stack the stack trace */ + @named("executionOutcomeDiagnostic") case class Diagnostic( kind: DiagnosticType, message: Option[String], @@ -1060,6 +629,7 @@ object Runtime { * @param message the error message * @param file the location of a file producing the error */ + @named("executionOutcomeFailure") case class Failure(message: String, file: Option[File]) extends ExecutionResult { @@ -1076,19 +646,6 @@ object Runtime { } - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[Export.Qualified], - name = "exportQualified" - ), - new JsonSubTypes.Type( - value = classOf[Export.Unqualified], - name = "exportUnqualified" - ) - ) - ) sealed trait Export { def module: String } @@ -1100,29 +657,18 @@ object Runtime { * @param alias new module name if the module was renamed in the export * clause */ + @named("exportQualified") case class Qualified(module: String, alias: Option[String]) extends Export /** Unqualified module export. * * @param module the module name that exports the given module */ + @named("exportUnqualified") case class Unqualified(module: String) extends Export } /** Base trait for runtime execution environment. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[ExecutionEnvironment.Live], - name = "executionEnvironmentLive" - ), - new JsonSubTypes.Type( - value = classOf[ExecutionEnvironment.Design], - name = "executionEnvironmentDesign" - ) - ) - ) sealed trait ExecutionEnvironment { /** The environment name. */ @@ -1130,12 +676,14 @@ object Runtime { } object ExecutionEnvironment { + @named("executionEnvironmentLive") final case class Live() extends ExecutionEnvironment { /** @inheritdoc */ override val name: String = "live" } + @named("executionEnvironmentDesign") final case class Design() extends ExecutionEnvironment { /** @inheritdoc */ @@ -1148,6 +696,7 @@ object Runtime { * @param contextId the context's id * @param diagnostics the list of diagnostic messages */ + @named("executionUpdate") final case class ExecutionUpdate( contextId: ContextId, diagnostics: Seq[ExecutionResult.Diagnostic] @@ -1167,6 +716,7 @@ object Runtime { * @param contextId the context's id * @param result the result of the execution */ + @named("executionFailed") final case class ExecutionFailed( contextId: ContextId, result: ExecutionResult @@ -1186,6 +736,7 @@ object Runtime { * @param visualizationContext a visualization context * @param data a visualization data */ + @named("visualizationUpdate") final case class VisualizationUpdate( visualizationContext: VisualizationContext, data: Array[Byte] @@ -1207,6 +758,7 @@ object Runtime { * @param oldVersion the current version of a buffer * @param newVersion the version of a buffer after applying all edits */ + @named("fileEdit") final case class FileEdit( path: File, edits: Vector[TextEdit], @@ -1229,6 +781,7 @@ object Runtime { * @param requestId the request identifier. * @param payload the request payload. */ + @named("request") final case class Request(requestId: Option[RequestId], payload: ApiRequest) extends ApiEnvelope @@ -1257,6 +810,7 @@ object Runtime { * @param correlationId request that initiated the response * @param payload response */ + @named("response") final case class Response( correlationId: Option[RequestId], payload: ApiResponse @@ -1287,6 +841,7 @@ object Runtime { * * @param contextId the newly created context's id. */ + @named("createContextRequest") final case class CreateContextRequest(contextId: ContextId) extends ApiRequest @@ -1294,6 +849,7 @@ object Runtime { * * @param contextId the newly created context's id. */ + @named("createContextResponse") final case class CreateContextResponse(contextId: ContextId) extends ApiResponse @@ -1302,6 +858,7 @@ object Runtime { * * @param contextId the destroyed context's id. */ + @named("destroyContextRequest") final case class DestroyContextRequest(contextId: ContextId) extends ApiRequest @@ -1310,6 +867,7 @@ object Runtime { * * @param contextId the destroyed context's id */ + @named("destroyContextResponse") final case class DestroyContextResponse(contextId: ContextId) extends ApiResponse @@ -1319,6 +877,7 @@ object Runtime { * @param contextId the context's id. * @param stackItem an item that should be pushed on the stack. */ + @named("pushContextRequest") final case class PushContextRequest( contextId: ContextId, stackItem: StackItem @@ -1328,6 +887,7 @@ object Runtime { * * @param contextId the context's id. */ + @named("pushContextResponse") final case class PushContextResponse(contextId: ContextId) extends ApiResponse @@ -1336,12 +896,14 @@ object Runtime { * * @param contextId the context's id. */ + @named("popContextRequest") final case class PopContextRequest(contextId: ContextId) extends ApiRequest /** A response sent from the server upon handling the [[PopContextRequest]] * * @param contextId the context's id. */ + @named("popContextResponse") final case class PopContextResponse(contextId: ContextId) extends ApiResponse @@ -1353,6 +915,7 @@ object Runtime { * recomputed. * @param executionEnvironment the environment used for execution */ + @named("recomputeContextRequest") final case class RecomputeContextRequest( contextId: ContextId, expressions: Option[InvalidatedExpressions], @@ -1364,6 +927,7 @@ object Runtime { * * @param contextId the context's id. */ + @named("recomputeContextResponse") final case class RecomputeContextResponse(contextId: ContextId) extends ApiResponse @@ -1372,6 +936,7 @@ object Runtime { * * @param contextId the context's id. */ + @named("interruptContextRequest") final case class InterruptContextRequest(contextId: ContextId) extends ApiRequest @@ -1380,12 +945,14 @@ object Runtime { * * @param contextId the context's id. */ + @named("interruptContextResponse") final case class InterruptContextResponse(contextId: ContextId) extends ApiResponse /** A request sent from the client to the runtime server to get the * component groups loaded in runtime. */ + @named("getComponentGroupsRequest") final case class GetComponentGroupsRequest() extends ApiRequest /** A response sent from the server upon handling the @@ -1394,6 +961,7 @@ object Runtime { * @param componentGroups the mapping containing the loaded component * groups */ + @named("getComponentGroupsResponse") final case class GetComponentGroupsResponse( componentGroups: Vector[(LibraryName, ComponentGroups)] ) extends ApiResponse @@ -1402,18 +970,21 @@ object Runtime { * * @param contextId the context's id */ + @named("contextNotExistError") final case class ContextNotExistError(contextId: ContextId) extends Error /** Signals that a module cannot be found. * * @param moduleName the module name */ + @named("moduleNotFound") final case class ModuleNotFound(moduleName: String) extends Error /** Signals that execution of a context completed. * * @param contextId the context's id */ + @named("executionSuccessful") final case class ExecutionComplete(contextId: ContextId) extends ApiNotification @@ -1423,6 +994,7 @@ object Runtime { * @param message the reason of the failure * @param failure the detailed information about the failure */ + @named("visualizationExpressionFailed") final case class VisualizationExpressionFailed( ctx: VisualizationContext, message: String, @@ -1448,6 +1020,7 @@ object Runtime { * @param message the reason of the failure * @param diagnostic the detailed information about the failure */ + @named("visualizationEvaluationFailed") final case class VisualizationEvaluationFailed( ctx: VisualizationContext, message: String, @@ -1465,18 +1038,21 @@ object Runtime { } /** Signals that visualization cannot be found. */ + @named("visualizationNotFound") final case class VisualizationNotFound() extends Error /** An error response signifying that stack is empty. * * @param contextId the context's id */ + @named("emptyStackError") final case class EmptyStackError(contextId: ContextId) extends Error /** An error response signifying that stack item is invalid. * * @param contextId the context's id */ + @named("invalidStackItemError") final case class InvalidStackItemError(contextId: ContextId) extends Error /** A request sent to the server to open a file with a contents. @@ -1484,6 +1060,7 @@ object Runtime { * @param path the file being moved to memory. * @param contents the current module's contents. */ + @named("setModuleSourcesNotification") final case class OpenFileRequest( path: File, contents: String @@ -1500,6 +1077,7 @@ object Runtime { /** A response from the server confirming opening of a file. */ + @named("moduleSourcesSetNotification") final case object OpenFileResponse extends ApiResponse /** A notification sent to the server about in-memory file contents being @@ -1509,6 +1087,7 @@ object Runtime { * @param edits the diffs to apply to the contents * @param execute whether to execute the program after applying the edits */ + @named("editFileNotification") final case class EditFileNotification( path: File, edits: Seq[TextEdit], @@ -1532,6 +1111,7 @@ object Runtime { * @param expressionId the expression to update * @param expressionValue the new value of the expression */ + @named("setExpressionValueNotification") final case class SetExpressionValueNotification( path: File, edits: Seq[TextEdit], @@ -1555,6 +1135,7 @@ object Runtime { * * @param path the file being closed. */ + @named("closeFileNotification") final case class CloseFileNotification(path: File) extends ApiRequest with ToLogString { @@ -1568,8 +1149,10 @@ object Runtime { * initialization. Any messages sent to the server before receiving this * message will be dropped. */ + @named("setExpressionValueNotification") final case class InitializedNotification() extends ApiResponse + @named("executeExpression") final case class ExecuteExpression( contextId: ContextId, visualizationId: VisualizationId, @@ -1585,6 +1168,7 @@ object Runtime { * @param visualizationConfig a configuration object for properties of the * visualization */ + @named("attachVisualization") final case class AttachVisualization( visualizationId: VisualizationId, expressionId: ExpressionId, @@ -1603,6 +1187,7 @@ object Runtime { /** Signals that attaching a visualization has succeeded. */ + @named("visualizationAttached") final case class VisualizationAttached() extends ApiResponse /** A request sent from the client to the runtime server, to detach a @@ -1612,6 +1197,7 @@ object Runtime { * @param visualizationId an identifier of a visualization * @param expressionId an identifier of an expression which is visualised */ + @named("detachVisualization") final case class DetachVisualization( contextId: ContextId, visualizationId: VisualizationId, @@ -1620,6 +1206,7 @@ object Runtime { /** Signals that detaching a visualization has succeeded. */ + @named("visualizationDetached") final case class VisualizationDetached() extends ApiResponse /** A request sent from the client to the runtime server, to modify a @@ -1629,6 +1216,7 @@ object Runtime { * @param visualizationConfig a configuration object for properties of the * visualization */ + @named("modifyVisualization") final case class ModifyVisualization( visualizationId: VisualizationId, visualizationConfig: VisualizationConfiguration @@ -1645,14 +1233,17 @@ object Runtime { /** Signals that a visualization modification has succeeded. */ + @named("visualizationModified") final case class VisualizationModified() extends ApiResponse /** A request to shut down the runtime server. */ + @named("shutDownRuntimeServer") final case class ShutDownRuntimeServer() extends ApiRequest /** Signals that the runtime server has been shut down. */ + @named("runtimeServerShutDown") final case class RuntimeServerShutDown() extends ApiResponse /** A request for project renaming. @@ -1661,6 +1252,7 @@ object Runtime { * @param oldName the old project name * @param newName the new project name */ + @named("renameProject") final case class RenameProject( namespace: String, oldName: String, @@ -1673,6 +1265,7 @@ object Runtime { * @param newNormalizedName new normalized name of the project * @param newName new display name of the project */ + @named("projectRenamed") final case class ProjectRenamed( oldNormalizedName: String, newNormalizedName: String, @@ -1684,6 +1277,7 @@ object Runtime { * @param oldName the old name of the project * @param newName the new name of the project */ + @named("projectRenameFailed") final case class ProjectRenameFailed(oldName: String, newName: String) extends Error @@ -1693,6 +1287,7 @@ object Runtime { * @param expressionId the symbol to rename * @param newName the new name of the symbol */ + @named("renameSymbol") final case class RenameSymbol( module: String, expressionId: ExpressionId, @@ -1703,39 +1298,27 @@ object Runtime { * * @param newName the new name of the symbol */ + @named("symbolRenamed") final case class SymbolRenamed(newName: String) extends ApiResponse /** Signals that the symbol rename has failed. * * @param error the error that happened */ + @named("symbolRenameFailed") final case class SymbolRenameFailed(error: SymbolRenameFailed.Error) extends Error object SymbolRenameFailed { - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") - @JsonSubTypes( - Array( - new JsonSubTypes.Type( - value = classOf[SymbolRenameFailed.ExpressionNotFound], - name = "symbolRenameFailedExpressionNotFound" - ), - new JsonSubTypes.Type( - value = classOf[SymbolRenameFailed.FailedToApplyEdits], - name = "symbolRenameFailedFailedToApplyEdits" - ), - new JsonSubTypes.Type( - value = classOf[SymbolRenameFailed.OperationNotSupported], - name = "symbolRenameFailedOperationNotSupported" - ) - ) - ) sealed trait Error + sealed trait Error /** Signals that an expression cannot be found by provided id. * * @param expressionId the id of expression */ + + @named("symbolRenameFailedExpressionNotFound") final case class ExpressionNotFound(expressionId: ExpressionId) extends SymbolRenameFailed.Error @@ -1743,6 +1326,7 @@ object Runtime { * * @param module the module name */ + @named("symbolRenameFailedFailedToApplyEdits") final case class FailedToApplyEdits(module: String) extends SymbolRenameFailed.Error @@ -1751,6 +1335,7 @@ object Runtime { * * @param expressionId the id of expression */ + @named("symbolRenameFailedOperationNotSupported") final case class OperationNotSupported(expressionId: ExpressionId) extends SymbolRenameFailed.Error } @@ -1762,6 +1347,7 @@ object Runtime { * @param exports the list of re-exported symbols * @param updates the list of suggestions extracted from module */ + @named("suggestionsDatabaseModuleUpdateNotification") final case class SuggestionsDatabaseModuleUpdateNotification( module: String, actions: Vector[SuggestionsDatabaseAction], @@ -1785,6 +1371,7 @@ object Runtime { * @param libraryName the name of the loaded library * @param suggestions the loaded suggestions */ + @named("suggestionsDatabaseSuggestionsLoadedNotification") final case class SuggestionsDatabaseSuggestionsLoadedNotification( libraryName: LibraryName, suggestions: Vector[Suggestion] @@ -1800,21 +1387,26 @@ object Runtime { } /** A notification about the finished background analyze job. */ + @named("analyzeModuleInScopeJobFinished") final case class AnalyzeModuleInScopeJobFinished() extends ApiNotification /** A request to invalidate the indexed flag of the modules. */ + @named("invalidateModulesIndexRequest") final case class InvalidateModulesIndexRequest() extends ApiRequest /** Signals that the module indexes has been invalidated. */ + @named("invalidateModulesIndexResponse") final case class InvalidateModulesIndexResponse() extends ApiResponse /** A request for the type hierarchy graph. */ + @named("getTypeGraphRequest") final case class GetTypeGraphRequest() extends ApiRequest /** The result of the type graph request. * * @param graph the graph. */ + @named("getTypeGraphResponse") final case class GetTypeGraphResponse(graph: TypeGraph) extends ApiResponse /** Signals that a new library has been imported, which means its content @@ -1826,6 +1418,7 @@ object Runtime { * @param location location on disk of the project root belonging to the * loaded library */ + @named("libraryLoaded") final case class LibraryLoaded( namespace: String, name: String, @@ -1837,6 +1430,7 @@ object Runtime { * * @param payload the actual update contained within this notification */ + @named("progressNotification") final case class ProgressNotification( payload: ProgressNotification.NotificationType ) extends ApiNotification @@ -1878,6 +1472,7 @@ object Runtime { * the lock has been successfully acquired (which * may take an arbitrarily large amount of time) */ + @named("acquireLockRequest") final case class AcquireLockRequest( resourceName: String, exclusive: Boolean, @@ -1889,12 +1484,14 @@ object Runtime { * @param lockId a unique identifier of the lock that can be used to * release it */ + @named("lockAcquired") final case class LockAcquired(lockId: UUID) extends ApiResponse /** A response indicating that the lock could not be acquired immediately. * * It is only sent if the request had `returnImmediately` set to true. */ + @named("cannotAcquireImmediately") final case class CannotAcquireImmediately() extends ApiResponse /** A response indicating a general failure to acquire the lock. @@ -1902,6 +1499,7 @@ object Runtime { * @param errorMessage message associated with the exception that caused * this failure */ + @named("lockAcquireFailed") final case class LockAcquireFailed(errorMessage: String) extends ApiResponse /** A request sent from the runtime to release a lock. @@ -1909,9 +1507,11 @@ object Runtime { * @param lockId the identifier of the lock to release, as specified in the * [[LockAcquired]] response */ + @named("releaseLockRequest") final case class ReleaseLockRequest(lockId: UUID) extends ApiRequest /** A response indicating that the lock has been successfully released. */ + @named("lockReleased") final case class LockReleased() extends ApiResponse /** A response indicating a general failure to release the lock. @@ -1919,6 +1519,7 @@ object Runtime { * @param errorMessage message associated with the exception that caused * this failure */ + @named("lockReleaseFailed") final case class LockReleaseFailed(errorMessage: String) extends ApiResponse /** A request to deserialize the library suggestions. @@ -1928,55 +1529,37 @@ object Runtime { * * @param libraryName the name of the loaded library. */ + @named("deserializeLibrarySuggestions") final case class DeserializeLibrarySuggestions(libraryName: LibraryName) extends ApiRequest /** A request to start the background jobs processing. */ + @named("startBackgroundProcessing") final case class StartBackgroundProcessing() extends ApiRequest /** A notification about started background jobs. */ + @named("backgroundJobsStartedNotification") final case class BackgroundJobsStartedNotification() extends ApiNotification /** A request to serialize the module. * * @param module qualified module name */ + @named("serializeModule") final case class SerializeModule(module: QualifiedName) extends ApiRequest /** A request to set the execution environment. */ + @named("setExecutionEnvironmentRequest") final case class SetExecutionEnvironmentRequest( contextId: ContextId, executionEnvironment: ExecutionEnvironment ) extends ApiRequest /** A response to the set execution environment request. */ + @named("setExecutionEnvironmentResponse") final case class SetExecutionEnvironmentResponse(contextId: ContextId) extends ApiResponse - private lazy val mapper = { - val factory = new CBORFactory() - val mapper = new ObjectMapper(factory) with ClassTagExtensions - mapper - .registerModule(DefaultScalaModule) - .registerModule(ScalaObjectDeserializerModule) - } - - /** Serializes an ApiEnvelope into a byte buffer. - * - * @param message the message to serialize. - * @return the serialized version of the message. - */ - def serialize(message: ApiEnvelope): ByteBuffer = - ByteBuffer.wrap(mapper.writeValueAsBytes(message)) - - /** Deserializes a byte buffer into an ApiEnvelope, which can be a Request - * or a Response. - * - * @param bytes the buffer to deserialize - * @return the deserialized message, if the byte buffer can be deserialized. - */ - def deserializeApiEnvelope(bytes: ByteBuffer): Try[ApiEnvelope] = - Try(mapper.readValue(bytes.array(), classOf[ApiEnvelope])) } } diff --git a/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala new file mode 100644 index 00000000000..385dc413d18 --- /dev/null +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala @@ -0,0 +1,40 @@ +package org.enso.polyglot.runtime.serde + +import org.enso.polyglot.runtime.Runtime.ApiEnvelope +import java.nio.ByteBuffer +import com.github.plokhotnyuk.jsoniter_scala.core.{ + readFromByteBuffer, + writeToArray, + JsonValueCodec +} + +import org.enso.polyglot.macros.SerdeConfig +import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker + +import scala.util.Try + +object ApiSerde { + + import SerdeConfig._ + + implicit private val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = + JsonCodecMaker.make[ApiEnvelope](config) + + /** Serializes an ApiEnvelope into a byte buffer. + * + * @param message the message to serialize. + * @return the serialized version of the message. + */ + def serialize(message: ApiEnvelope): ByteBuffer = { + ByteBuffer.wrap(writeToArray(message)) + } + + /** Deserializes a byte buffer into an ApiEnvelope, which can be a Request + * or a Response. + * + * @param bytes the buffer to deserialize + * @return the deserialized message, if the byte buffer can be deserialized. + */ + def deserializeApiEnvelope(bytes: ByteBuffer): Try[ApiEnvelope] = + Try(readFromByteBuffer[ApiEnvelope](bytes)) +} diff --git a/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala b/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala new file mode 100644 index 00000000000..b976007575b --- /dev/null +++ b/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala @@ -0,0 +1,141 @@ +package org.enso.polyglot.runtime.serde + +import java.util.UUID + +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers + +import org.enso.polyglot.Suggestion +import org.enso.polyglot.data.Tree +import org.enso.polyglot.runtime.Runtime.Api.SuggestionAction +import org.enso.polyglot.runtime.Runtime.{Api, ApiEnvelope} + +class SerdeSpec extends AnyFlatSpec with Matchers { + + it should "serialize and deserialize API messages in JSON" in { + val message: ApiEnvelope = Api.Response( + Api.SuggestionsDatabaseModuleUpdateNotification( + module = "Dummy", + actions = Vector.empty, + exports = Vector.empty, + updates = Tree.Root( + children = Vector( + Tree.Node( + element = Api.SuggestionUpdate( + suggestion = Suggestion + .Module("local.New_Project_1.Main", documentation = None), + action = SuggestionAction.Add() + ), + children = Vector.empty + ), + Tree.Node( + element = Api.SuggestionUpdate( + suggestion = Suggestion + .DefinedMethod( + externalId = Some(UUID.randomUUID()), + module = "local.New_Project_1.Main", + name = "main", + arguments = Seq.empty, + selfType = "local.New_Project_1.Main", + returnType = "Standard.Base.Any.Any", + isStatic = true, + documentation = None, + annotations = Seq.empty + ), + action = SuggestionAction.Add() + ), + children = Vector( + Tree.Node( + element = Api.SuggestionUpdate( + suggestion = Suggestion + .Local( + externalId = Some(UUID.randomUUID()), + module = "local.New_Project_1.Main", + name = "main", + returnType = "Standard.Base.Any.Any", + scope = Suggestion.Scope( + Suggestion.Position(0, 1), + Suggestion.Position(2, 3) + ), + documentation = None + ), + action = SuggestionAction.Add() + ), + children = Vector.empty + ), + Tree.Node( + element = Api.SuggestionUpdate( + suggestion = Suggestion + .Type( + externalId = Some(UUID.randomUUID()), + module = "Standard.Base.Data.Set", + name = "Set", + params = Seq( + Suggestion + .Argument("foo", "bar", true, false, None, None) + ), + returnType = "Standard.Base.Data.Set.Set", + parentType = Some("Standard.Base.Any.Any"), + documentation = + Some(" An unordered collection of unique values"), + reexports = Set("foo") + ), + action = SuggestionAction.Modify(documentation = Some(None)) + ), + children = Vector.empty + ), + Tree.Node( + element = Api.SuggestionUpdate( + suggestion = Suggestion + .Type( + externalId = Some(UUID.randomUUID()), + module = "Standard.Base.Data.Vector", + name = "Set", + params = Seq( + Suggestion + .Argument("foo", "bar", true, false, None, None) + ), + returnType = "Standard.Base.Data.Set.Set", + parentType = Some("Standard.Base.Any.Any"), + documentation = + Some(" An unordered collection of unique values"), + reexports = Set("foo") + ), + action = SuggestionAction.Modify( + documentation = Some(None), + returnType = Some("foo") + ) + ), + children = Vector.empty + ) + ) + ) + ) + ) + ) + ) + + val d1 = ApiSerde.serialize(message) + val d2 = ApiSerde.deserializeApiEnvelope(d1).get + + message should equal(d2) + + val libLoaded = + Api.Response( + None, + Api.LibraryLoaded( + "Standard", + "Base", + "0.0.0-dev", + new java.io.File( + "enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev" + ) + ) + ) + val e1 = ApiSerde.serialize(libLoaded) + val e2 = ApiSerde.deserializeApiEnvelope(e1).get + + libLoaded should equal(e2) + } + +} diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Endpoint.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Endpoint.scala index e92da20167e..f5b1efbbc61 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Endpoint.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Endpoint.scala @@ -5,6 +5,7 @@ import org.enso.lockmanager.client.{ RuntimeServerRequestHandler } import org.enso.polyglot.runtime.Runtime.{Api, ApiRequest, ApiResponse} +import org.enso.polyglot.runtime.serde.ApiSerde import org.graalvm.polyglot.io.MessageEndpoint import java.nio.ByteBuffer @@ -20,7 +21,7 @@ class Endpoint(handler: Handler) */ private val reverseRequestEndpoint = new RuntimeServerRequestHandler { override def sendToClient(request: Api.Request): Unit = - client.sendBinary(Api.serialize(request)) + client.sendBinary(ApiSerde.serialize(request)) } var client: MessageEndpoint = _ @@ -36,7 +37,7 @@ class Endpoint(handler: Handler) * @param msg the message to send. */ def sendToClient(msg: Api.Response): Unit = - client.sendBinary(Api.serialize(msg)) + client.sendBinary(ApiSerde.serialize(msg)) /** Sends a notification to the runtime. * @@ -54,7 +55,7 @@ class Endpoint(handler: Handler) override def sendText(text: String): Unit = {} override def sendBinary(data: ByteBuffer): Unit = - Api.deserializeApiEnvelope(data).foreach { + ApiSerde.deserializeApiEnvelope(data).foreach { case request: Api.Request => handler.onMessage(request) case response: Api.Response => diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala index b81b2ab844d..34ecf516d53 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala @@ -1,6 +1,5 @@ package org.enso.interpreter.instrument.job -import cats.implicits._ import com.oracle.truffle.api.TruffleLogger import org.enso.common.CompilationStage import org.enso.compiler.CompilerResult @@ -287,19 +286,24 @@ final class EnsureCompiledJob( private def compile( module: Module )(implicit ctx: RuntimeContext): Either[Throwable, CompilerResult] = - Either.catchNonFatal { + try { val compilationStage = module.getCompilationStage if (!compilationStage.isAtLeast(CompilationStage.AFTER_CODEGEN)) { ctx.executionService.getLogger .log(Level.FINEST, s"Compiling ${module.getName}.") val result = ctx.executionService.getContext.getCompiler .run(module.asCompilerModule()) - result.copy(compiledModules = - result.compiledModules.filter(_.getName != module.getName) + Right( + result.copy(compiledModules = + result.compiledModules.filter(_.getName != module.getName) + ) ) } else { - CompilerResult.empty + Right(CompilerResult.empty) } + } catch { + case e: Throwable => + Left(e) } /** Apply pending edits to the file. diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/context/JacksonTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/context/JacksonTest.java deleted file mode 100644 index 834bab08da2..00000000000 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/context/JacksonTest.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.enso.compiler.test.context; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.module.scala.DefaultScalaModule; -import java.util.List; -import org.enso.interpreter.util.ScalaConversions; -import org.enso.polyglot.Suggestion; -import org.junit.Test; -import scala.Option; - -public class JacksonTest { - - @Test - public void testSerdeOfSuggestion() throws Exception { - Object shape = - new Suggestion.Module("SampleModule", Option.apply("doc"), ScalaConversions.set()); - final ObjectMapper m = new ObjectMapper().registerModule(new DefaultScalaModule()); - String result = m.writerWithDefaultPrettyPrinter().writeValueAsString(shape); - - Suggestion suggestion = m.readerFor(Suggestion.class).readValue(result); - assertEquals("SampleModule", suggestion.name()); - assertEquals("doc", suggestion.documentation().get()); - assertEquals(Suggestion.Module.class, suggestion.getClass()); - } - - @Test - public void testArraySerdeOfSuggestion() throws Exception { - Object shape = - new Suggestion[] { - new Suggestion.Module("SampleModule", Option.apply("doc"), ScalaConversions.set()) - }; - final ObjectMapper m = new ObjectMapper().registerModule(new DefaultScalaModule()); - String result = m.writerWithDefaultPrettyPrinter().writeValueAsString(shape); - - var it = m.readerFor(Suggestion.class).readValues(result); - var suggestion = it.nextValue(); - assertEquals(Suggestion.Module.class, suggestion.getClass()); - if (suggestion instanceof Suggestion.Module module) { - assertEquals("SampleModule", module.name()); - assertEquals("doc", module.documentation().get()); - } else { - fail("Expecting Suggestion.Module: " + suggestion); - } - } - - @Test - public void testRecordSerdeOfSuggestion() throws Exception { - Object shape = - new SuggestionCache( - 11, - List.of( - new Suggestion.Module( - "SampleModule", Option.apply("doc"), ScalaConversions.set()))); - final ObjectMapper m = new ObjectMapper().registerModule(new DefaultScalaModule()); - String result = m.writerWithDefaultPrettyPrinter().writeValueAsString(shape); - - var cache = (SuggestionCache) m.readerFor(SuggestionCache.class).readValue(result); - assertEquals("One suggestion", 1, cache.suggestions.size()); - if (cache.suggestions().get(0) instanceof Suggestion.Module module) { - assertEquals("SampleModule", module.name()); - assertEquals("doc", module.documentation().get()); - } else { - fail("Expecting Suggestion.Module: " + cache); - } - } - - public record SuggestionCache( - @JsonProperty("version") int version, - @JsonProperty("suggestions") List suggestions) {} -} diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerEmulator.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerEmulator.scala index a4a90711262..90be3a5ea1e 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerEmulator.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerEmulator.scala @@ -5,6 +5,7 @@ import org.enso.distribution.locking.ThreadSafeLockManager import org.enso.lockmanager.server.LockManagerService import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api +import org.enso.polyglot.runtime.serde.ApiSerde import org.graalvm.polyglot.io.{MessageEndpoint, MessageTransport} import java.nio.ByteBuffer @@ -46,13 +47,13 @@ class RuntimeServerEmulator( private val connector = system.actorOf( TestRuntimeServerConnector.props( lockManagerService, - { response => endpoint.sendBinary(Api.serialize(response)) } + { response => endpoint.sendBinary(ApiSerde.serialize(response)) } ) ) /** Sends a message to the runtime. */ def sendToRuntime(msg: Api.Request): Unit = - endpoint.sendBinary(Api.serialize(msg)) + endpoint.sendBinary(ApiSerde.serialize(msg)) /** Creates a [[MessageTransport]] that should be provided when building the * context. @@ -64,7 +65,7 @@ class RuntimeServerEmulator( override def sendText(text: String): Unit = {} override def sendBinary(data: ByteBuffer): Unit = { - Api.deserializeApiEnvelope(data) match { + ApiSerde.deserializeApiEnvelope(data) match { case Success(request: Api.Request) => connector ! request case Success(response: Api.Response) => diff --git a/engine/runtime/src/main/java/org/enso/interpreter/caches/CacheUtils.java b/engine/runtime/src/main/java/org/enso/interpreter/caches/CacheUtils.java index 24c3ff13e05..372c09948c0 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/caches/CacheUtils.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/caches/CacheUtils.java @@ -2,6 +2,7 @@ package org.enso.interpreter.caches; import com.oracle.truffle.api.TruffleFile; import java.io.IOException; +import java.io.InputStream; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -19,6 +20,8 @@ import org.enso.text.Hex; final class CacheUtils { private CacheUtils() {} + private static int BUFFER_SIZE = 1024; + static Function writeReplace(CompilerContext context, boolean keepUUIDs) { return (obj) -> switch (obj) { @@ -82,7 +85,14 @@ final class CacheUtils { try { var digest = messageDigest(); for (var source : pkgSources) { - digest.update(source.file().readAllBytes()); + byte[] buffer = new byte[BUFFER_SIZE]; + try (InputStream is = source.file().newInputStream()) { + int read = is.read(buffer, 0, BUFFER_SIZE); + while (read > -1) { + digest.update(buffer, 0, read); + read = is.read(buffer, 0, BUFFER_SIZE); + } + } } return Hex.toHexString(digest.digest()); } catch (IOException ex) { diff --git a/tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt b/tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt deleted file mode 100644 index 71e1f423f69..00000000000 --- a/tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt +++ /dev/null @@ -1,145 +0,0 @@ -Here are people who have contributed to the development of Jackson JSON processor -binary data formats module -(version numbers in brackets indicate release in which the problem was fixed) - -Tatu Saloranta (tatu.saloranta@iki.fi): author - --------------------------------------------------------------------------------- -Credits for individual projects, since 2.8.0 --------------------------------------------------------------------------------- - -Michael Zeng (shotbythought@github) - -* Contributed fix for #27: (protobuf) Fixed long deserialization problem for longs of ~13digit length - (2.8.2) -* Reported #58 (avro): Regression due to changed namespace of inner enum types - (2.8.8) - -Kenji Noguchi (knoguchi@github) - -* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field - (2.8.9) - -marsqing@github - -* Reported #85: (protobuf) _decode32Bits() bug in ProtobufParser - (2.8.9) -* Reported #94: (protobuf) Should _ensureRoom in ProtobufGenerator.writeString() - (2.8.10) -* Reported #106 (protobuf), contributed fix for: calling _skipUnknownValue() twice - (2.8.11 / 2.9.1) -* Reported #116 (protobuf), contributed fix for: Should skip the positive byte - which is the last byte of an varint - (2.9.3) -* Reported #126, contributed fix for: always call checkEnd() when skip unknown field - (2.8.11 / 2.9.3) - -baharclerode@github: - -* Contributed #14 (avro): Add support for Avro annotations via `AvroAnnotationIntrospector` - (2.9.0) -* Contributed #15 (avro): Add a way to produce "file" style Avro output - (2.9.0) -* Contributed #57 (avro): Add support for @Stringable annotation - (2.9.0) -* Contributed #59 (avro): Add support for @AvroAlias annotation for Record/Enum name evolution - (2.9.0) -* Contributed #60 (avro): Add support for `@Union` and polymorphic types - (2.9.0) - -Eldad Rudich (eldadru@github) - -* Reported #68 (proto): Getting "type not supported as root type by protobuf" for serialization - of short and UUID types - (2.9.0) - -philipa@github - -* Reported #114 (cbor), contributed fix for: copyStructure(): avoid duplicate tags - when copying tagged binary - (2.9.3) - -Jacek Lach (JacekLach@github) - -* Reported #124: Invalid value returned for negative int32 where the absolute value is > 2^31 - 1 - (2.9.3) - -Leo Wang (wanglingsong@github) - -* Reported #135: Infinite sequence of `END_OBJECT` tokens returned at end of streaming read - (2.9.6) - -Michael Milkin (mmilkin@github) -* Reported, Contributed fix for #142: (ion) `IonParser.getNumberType()` returns `null` - for `IonType.FLOAT` - (2.9.7) - -Guido Medina (guidomedina@github) -* Reported #153: (smile) Unable to set a compression input/output decorator to a `SmileFactory` - (2.9.8) - -Alexander Cyon (Sajjon@github) -* Reported #159: (cbor) Some short UTF Strings encoded using non-canonical form - (2.9.9) - -Łukasz Dziedziak (lukidzi@github) -* Reported, contributed fix for #161: (avro) Deserialize from newer version to older - one throws NullPointerException - (2.9.9) - -Carter Kozak (cakofony@github) -* Reported, suggested fix for #155: Inconsistent support for FLUSH_PASSED_TO_STREAM - (2.10.0) - -Fernando Raganhan Barbosa (raganhan@github) -* Suggested #163: (ion) Update `ion-java` dependency - (2.10.0) - -Juliana Amorim (amorimjuliana@github) -* Reported #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) - -Marcos Passos (marcospassos@github) -* Contributed fix for #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) -* Contributed fix for #173: (avro) Improve Union type serialization performance - (2.10.0) -* Contributed fix for #211: (avro) Fix schema evolution involving maps of non-scalar - (2.10.5) -* Contributed fix for #216: (avro) Avro null deserialization - (2.11.2) -* Contributed #219: Cache record names to avoid hitting class loader - (2.11.3) - -John (iziamos@github) -* Reported, suggested fix for #178: Fix issue wit input offsets when parsing CBOR from `InputStream` - (2.10.0) - -Paul Adolph (padolph@github) -* Reported #185: Internal parsing of tagged arrays can lead to stack overflow - (2.10.1) - -Yanming Zhou (quaff@github) -* Reported #188: Unexpected `MismatchedInputException` for `byte[]` value bound to `String` - in collection/array - (2.10.1) - -Zack Slayton (zslayton@github) -* Reported, contributed fix for #189: (ion) IonObjectMapper close()s the provided IonWriter unnecessarily - (2.10.2) - -Binh Tran (ankel@github) -* Reported, contributed fix for #192: (ion) Allow `IonObjectMapper` with class name annotation introspector - to deserialize generic subtypes - (2.11.0) - -Jonas Konrad (yawkat@github) -* Reported, contributed fix for #201: `CBORGenerator.Feature.WRITE_MINIMAL_INTS` does not write - most compact form for all integers - (2.11.0) - -Michael Liedtke (mcliedtke@github) - -* Contributed fix for #212: (ion) Optimize `IonParser.getNumberType()` using - `IonReader.getIntegerSize()` - (2.12.0) diff --git a/tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore b/tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore deleted file mode 100644 index 26e9c87b612..00000000000 --- a/tools/legal-review/engine/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore +++ /dev/null @@ -1,2 +0,0 @@ -META-INF/NOTICE -META-INF/LICENSE diff --git a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore b/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore deleted file mode 100644 index b7498f2ff8d..00000000000 --- a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore +++ /dev/null @@ -1 +0,0 @@ -The scalabeans code is covered by the copyright statement that follows. diff --git a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-keep b/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-keep deleted file mode 100644 index 2aba3b414bd..00000000000 --- a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-keep +++ /dev/null @@ -1 +0,0 @@ -Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich) diff --git a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep b/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep deleted file mode 100644 index b9005a4d5ae..00000000000 --- a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep +++ /dev/null @@ -1 +0,0 @@ -META-INF/LICENSE diff --git a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/custom-license b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license similarity index 100% rename from tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/custom-license rename to tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license diff --git a/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep new file mode 100644 index 00000000000..ed345faefce --- /dev/null +++ b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep @@ -0,0 +1 @@ +/plokhotnyuk/jsoniter-scala/blob/master/LICENSE diff --git a/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license new file mode 100644 index 00000000000..6b1d0bfabc3 --- /dev/null +++ b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license @@ -0,0 +1 @@ +LICENSE diff --git a/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep new file mode 100644 index 00000000000..ed345faefce --- /dev/null +++ b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep @@ -0,0 +1 @@ +/plokhotnyuk/jsoniter-scala/blob/master/LICENSE diff --git a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-add b/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-add deleted file mode 100644 index ba17e72188d..00000000000 --- a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-add +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * - * Copyright (c) 2007 Paul Hammant - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*** - * - * Portions Copyright (c) 2007 Paul Hammant - * Portions copyright (c) 2000-2007 INRIA, France Telecom - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ diff --git a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore b/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore deleted file mode 100644 index 4d04b258f4f..00000000000 --- a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore +++ /dev/null @@ -1,9 +0,0 @@ -1. Redistributions of source code must retain the above copyright -2. Redistributions in binary form must reproduce the above copyright -3. Neither the name of the copyright holders nor the names of its -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -Copyright (c) 2007 Paul Hammant -Copyright (c) 2009 Paul Hammant -Portions Copyright (c) 2007 Paul Hammant -Portions copyright (c) 2000-2007 INRIA, France Telecom -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" diff --git a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context b/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context deleted file mode 100644 index 6814e7da60f..00000000000 --- a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2013 Stefan Fleiter -Copyright 2013 Samuel Halliday diff --git a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/custom-license b/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/custom-license deleted file mode 100644 index 663c2fd0902..00000000000 --- a/tools/legal-review/engine/com.thoughtworks.paranamer.paranamer-2.8/custom-license +++ /dev/null @@ -1 +0,0 @@ -NOTICES diff --git a/tools/legal-review/engine/report-state b/tools/legal-review/engine/report-state index 43caea6d554..278bf56e6d7 100644 --- a/tools/legal-review/engine/report-state +++ b/tools/legal-review/engine/report-state @@ -1,3 +1,3 @@ -7255345E2327C888424E105C9BDCAC88093A45A99DAB595112AD9F277198A841 -628AFF763350011A2AD598D7203867862925EC3FAB1F46CB86E95D21FFB52CC9 +18BDE068A3B0348CA51E2E8ACD035F5FDE5ACABFBE472FC6E2DC0534E2008531 +6BDC0CFBC6B989AB54B80972AA01FA38B296187CFEEB80A14B3DC14F99B64586 0 diff --git a/tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt b/tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt deleted file mode 100644 index 71e1f423f69..00000000000 --- a/tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-add/CREDITS-2.x.txt +++ /dev/null @@ -1,145 +0,0 @@ -Here are people who have contributed to the development of Jackson JSON processor -binary data formats module -(version numbers in brackets indicate release in which the problem was fixed) - -Tatu Saloranta (tatu.saloranta@iki.fi): author - --------------------------------------------------------------------------------- -Credits for individual projects, since 2.8.0 --------------------------------------------------------------------------------- - -Michael Zeng (shotbythought@github) - -* Contributed fix for #27: (protobuf) Fixed long deserialization problem for longs of ~13digit length - (2.8.2) -* Reported #58 (avro): Regression due to changed namespace of inner enum types - (2.8.8) - -Kenji Noguchi (knoguchi@github) - -* Reported #70 (protobuf), contributed fix: Can't deserialize packed repeated field - (2.8.9) - -marsqing@github - -* Reported #85: (protobuf) _decode32Bits() bug in ProtobufParser - (2.8.9) -* Reported #94: (protobuf) Should _ensureRoom in ProtobufGenerator.writeString() - (2.8.10) -* Reported #106 (protobuf), contributed fix for: calling _skipUnknownValue() twice - (2.8.11 / 2.9.1) -* Reported #116 (protobuf), contributed fix for: Should skip the positive byte - which is the last byte of an varint - (2.9.3) -* Reported #126, contributed fix for: always call checkEnd() when skip unknown field - (2.8.11 / 2.9.3) - -baharclerode@github: - -* Contributed #14 (avro): Add support for Avro annotations via `AvroAnnotationIntrospector` - (2.9.0) -* Contributed #15 (avro): Add a way to produce "file" style Avro output - (2.9.0) -* Contributed #57 (avro): Add support for @Stringable annotation - (2.9.0) -* Contributed #59 (avro): Add support for @AvroAlias annotation for Record/Enum name evolution - (2.9.0) -* Contributed #60 (avro): Add support for `@Union` and polymorphic types - (2.9.0) - -Eldad Rudich (eldadru@github) - -* Reported #68 (proto): Getting "type not supported as root type by protobuf" for serialization - of short and UUID types - (2.9.0) - -philipa@github - -* Reported #114 (cbor), contributed fix for: copyStructure(): avoid duplicate tags - when copying tagged binary - (2.9.3) - -Jacek Lach (JacekLach@github) - -* Reported #124: Invalid value returned for negative int32 where the absolute value is > 2^31 - 1 - (2.9.3) - -Leo Wang (wanglingsong@github) - -* Reported #135: Infinite sequence of `END_OBJECT` tokens returned at end of streaming read - (2.9.6) - -Michael Milkin (mmilkin@github) -* Reported, Contributed fix for #142: (ion) `IonParser.getNumberType()` returns `null` - for `IonType.FLOAT` - (2.9.7) - -Guido Medina (guidomedina@github) -* Reported #153: (smile) Unable to set a compression input/output decorator to a `SmileFactory` - (2.9.8) - -Alexander Cyon (Sajjon@github) -* Reported #159: (cbor) Some short UTF Strings encoded using non-canonical form - (2.9.9) - -Łukasz Dziedziak (lukidzi@github) -* Reported, contributed fix for #161: (avro) Deserialize from newer version to older - one throws NullPointerException - (2.9.9) - -Carter Kozak (cakofony@github) -* Reported, suggested fix for #155: Inconsistent support for FLUSH_PASSED_TO_STREAM - (2.10.0) - -Fernando Raganhan Barbosa (raganhan@github) -* Suggested #163: (ion) Update `ion-java` dependency - (2.10.0) - -Juliana Amorim (amorimjuliana@github) -* Reported #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) - -Marcos Passos (marcospassos@github) -* Contributed fix for #168: (avro) `JsonMappingException` for union types with multiple Record types - (2.10.0) -* Contributed fix for #173: (avro) Improve Union type serialization performance - (2.10.0) -* Contributed fix for #211: (avro) Fix schema evolution involving maps of non-scalar - (2.10.5) -* Contributed fix for #216: (avro) Avro null deserialization - (2.11.2) -* Contributed #219: Cache record names to avoid hitting class loader - (2.11.3) - -John (iziamos@github) -* Reported, suggested fix for #178: Fix issue wit input offsets when parsing CBOR from `InputStream` - (2.10.0) - -Paul Adolph (padolph@github) -* Reported #185: Internal parsing of tagged arrays can lead to stack overflow - (2.10.1) - -Yanming Zhou (quaff@github) -* Reported #188: Unexpected `MismatchedInputException` for `byte[]` value bound to `String` - in collection/array - (2.10.1) - -Zack Slayton (zslayton@github) -* Reported, contributed fix for #189: (ion) IonObjectMapper close()s the provided IonWriter unnecessarily - (2.10.2) - -Binh Tran (ankel@github) -* Reported, contributed fix for #192: (ion) Allow `IonObjectMapper` with class name annotation introspector - to deserialize generic subtypes - (2.11.0) - -Jonas Konrad (yawkat@github) -* Reported, contributed fix for #201: `CBORGenerator.Feature.WRITE_MINIMAL_INTS` does not write - most compact form for all integers - (2.11.0) - -Michael Liedtke (mcliedtke@github) - -* Contributed fix for #212: (ion) Optimize `IonParser.getNumberType()` using - `IonReader.getIntegerSize()` - (2.12.0) diff --git a/tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore b/tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore deleted file mode 100644 index 26e9c87b612..00000000000 --- a/tools/legal-review/project-manager/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.15.2/files-ignore +++ /dev/null @@ -1,2 +0,0 @@ -META-INF/NOTICE -META-INF/LICENSE diff --git a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-add b/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-add deleted file mode 100644 index fdb813a69ae..00000000000 --- a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-add +++ /dev/null @@ -1,28 +0,0 @@ ------------------------- - -From file com/fasterxml/jackson/module/scala/introspect/BeanIntrospector.scala: - -/* - * Derived from source code of scalabeans: - * https://raw.github.com/scalastuff/scalabeans/62b50c4e2482cbc1f494e0ac5c6c54fadc1bbcdd/src/main/scala/org/scalastuff/scalabeans/BeanIntrospector.scala - * - * The scalabeans code is covered by the copyright statement that follows. - */ - -/* - * Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - ------------------------- diff --git a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore b/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore deleted file mode 100644 index b5c5695996a..00000000000 --- a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/copyright-ignore +++ /dev/null @@ -1,2 +0,0 @@ -The scalabeans code is covered by the copyright statement that follows. -Copyright (c) 2011 ScalaStuff.org (joint venture of Alexander Dvorkovyy and Ruud Diterwich) diff --git a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/default-and-custom-license b/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/default-and-custom-license deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep b/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep deleted file mode 100644 index b9005a4d5ae..00000000000 --- a/tools/legal-review/project-manager/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/files-keep +++ /dev/null @@ -1 +0,0 @@ -META-INF/LICENSE diff --git a/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license new file mode 100644 index 00000000000..6b1d0bfabc3 --- /dev/null +++ b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license @@ -0,0 +1 @@ +LICENSE diff --git a/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep new file mode 100644 index 00000000000..ed345faefce --- /dev/null +++ b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/files-keep @@ -0,0 +1 @@ +/plokhotnyuk/jsoniter-scala/blob/master/LICENSE diff --git a/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license new file mode 100644 index 00000000000..6b1d0bfabc3 --- /dev/null +++ b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/custom-license @@ -0,0 +1 @@ +LICENSE diff --git a/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep new file mode 100644 index 00000000000..ed345faefce --- /dev/null +++ b/tools/legal-review/project-manager/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-macros_2.13-2.28.5/files-keep @@ -0,0 +1 @@ +/plokhotnyuk/jsoniter-scala/blob/master/LICENSE diff --git a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-add b/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-add deleted file mode 100644 index ba17e72188d..00000000000 --- a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-add +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * - * Copyright (c) 2007 Paul Hammant - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/*** - * - * Portions Copyright (c) 2007 Paul Hammant - * Portions copyright (c) 2000-2007 INRIA, France Telecom - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ diff --git a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore b/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore deleted file mode 100644 index 4d04b258f4f..00000000000 --- a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-ignore +++ /dev/null @@ -1,9 +0,0 @@ -1. Redistributions of source code must retain the above copyright -2. Redistributions in binary form must reproduce the above copyright -3. Neither the name of the copyright holders nor the names of its -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -Copyright (c) 2007 Paul Hammant -Copyright (c) 2009 Paul Hammant -Portions Copyright (c) 2007 Paul Hammant -Portions copyright (c) 2000-2007 INRIA, France Telecom -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" diff --git a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context b/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context deleted file mode 100644 index 6814e7da60f..00000000000 --- a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/copyright-keep-context +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2013 Stefan Fleiter -Copyright 2013 Samuel Halliday diff --git a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/custom-license b/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/custom-license deleted file mode 100644 index 663c2fd0902..00000000000 --- a/tools/legal-review/project-manager/com.thoughtworks.paranamer.paranamer-2.8/custom-license +++ /dev/null @@ -1 +0,0 @@ -NOTICES diff --git a/tools/legal-review/project-manager/report-state b/tools/legal-review/project-manager/report-state index 5f2880e97cc..c025470e934 100644 --- a/tools/legal-review/project-manager/report-state +++ b/tools/legal-review/project-manager/report-state @@ -1,3 +1,3 @@ -ECE7DA5C5F2AA668330D02E802158890374B9E29D008A9752FDC31B97894A1DC -9C894B66374B5FA85C5ACA368DAAA5934DD295F4233911B5A4CB2B6E46A100B4 +482FAAF233FCF62EB6FC44FEC957DC79001FF33F15D640C542A03482F452C982 +707A702E516A641673B26AAD1F4BC35919B4DBB0C3E3D76BD032C3FF2A54A8D7 0