From e3a83e077c5cd00b25b486e26dfbfc301f535c0c Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Sun, 19 May 2024 22:26:01 +0200 Subject: [PATCH 01/18] Minor perf nits discovered while profiling 1. Avoiding loading cats. It will we loaded later anyway but `catchNonFatal` is not worth it anyway 2. Avoid copying when reading all bytes from a file to compute digest of all files --- .../instrument/job/EnsureCompiledJob.scala | 14 +++++++++----- .../org/enso/interpreter/caches/CacheUtils.java | 12 +++++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) 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 49688b1120e3..0f3acac22a5e 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 @@ -282,19 +281,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/src/main/java/org/enso/interpreter/caches/CacheUtils.java b/engine/runtime/src/main/java/org/enso/interpreter/caches/CacheUtils.java index f90f4edfe204..1b5841671c55 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 @@ 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; @@ -17,6 +18,8 @@ final class CacheUtils { private CacheUtils() {} + private static int BUFFER_SIZE = 1024; + static Function writeReplace(CompilerContext context, boolean keepUUIDs) { return (obj) -> switch (obj) { @@ -80,7 +83,14 @@ static final String computeDigestOfLibrarySources(List> 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) { From e784da3e763af42197903737acb3551ea44aed4a Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Wed, 22 May 2024 11:40:21 +0200 Subject: [PATCH 02/18] Experimenting with jsoniter-scala --- build.sbt | 16 ++- .../main/scala/org/enso/common/Serde.scala | 57 ++++++++ .../scala/org/enso/polyglot/Suggestion.scala | 18 ++- .../org/enso/polyglot/runtime/Runtime.scala | 28 ++-- .../org/enso/polyglot/runtime/SerdeSpec.scala | 134 ++++++++++++++++++ 5 files changed, 220 insertions(+), 33 deletions(-) create mode 100644 engine/common/src/main/scala/org/enso/common/Serde.scala create mode 100644 engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala diff --git a/build.sbt b/build.sbt index e78caba357f9..9e557438d55e 100644 --- a/build.sbt +++ b/build.sbt @@ -1358,7 +1358,8 @@ lazy val `engine-common` = project Test / javaOptions ++= Seq( ), libraryDependencies ++= Seq( - "org.graalvm.polyglot" % "polyglot" % graalMavenPackagesVersion % "provided" + "org.graalvm.polyglot" % "polyglot" % graalMavenPackagesVersion % "provided", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.5" % "provided" ) ) .dependsOn(testkit % Test) @@ -1380,11 +1381,14 @@ 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.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion, + "io.circe" %% "circe-core" % circeVersion, + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.5" % "provided", + "org.scalatest" %% "scalatest" % scalatestVersion % Test, + "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ), libraryDependencies ++= jackson, GenerateFlatbuffers.flatcVersion := flatbuffersVersion, diff --git a/engine/common/src/main/scala/org/enso/common/Serde.scala b/engine/common/src/main/scala/org/enso/common/Serde.scala new file mode 100644 index 000000000000..558aeedd3ad3 --- /dev/null +++ b/engine/common/src/main/scala/org/enso/common/Serde.scala @@ -0,0 +1,57 @@ +package org.enso.common + + +import com.github.plokhotnyuk.jsoniter_scala.macros._ +import com.github.plokhotnyuk.jsoniter_scala.core._ + +import java.io.File + +object Serde { + + val config = CodecMakerConfig + .withAllowRecursiveTypes(allowRecursiveTypes = true) + .withRequireCollectionFields(requireCollectionFields = true) + .withTransientEmpty(false) + + implicit lazy 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 if (t == '"') { + in.rollbackToken() + val path = in.readString(null) + if (path == null) null + else new File(path) + } else if (t == '{') { + if (!in.isNextToken('}')) { + in.rollbackToken() + val key = in.readKeyAsString() + if (key != "file") { + throw new RuntimeException("invalid field name, expected `file` got `" + key + "`") + } + val path = in.readString(null) + if (!in.isNextToken('}')) { + in.objectEndOrCommaError() + } + new File(path) + } else { + null + } + + } else throw new RuntimeException("Invalid value, cannot deserialize at " + t) + } + + override def encodeValue(x: File, out: JsonWriter): Unit = { + out.writeObjectStart() + if (x == null) out.writeNull() + else { + out.writeKey("file") + out.writeVal(x.getPath) + } + out.writeObjectEnd() + } + + override def nullValue: File = null + } +} 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 c11f23eb4399..e7a88b90023d 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 @@ -5,8 +5,6 @@ import org.enso.logger.masking.ToLogString import java.util.UUID -import scala.collection.immutable.ListSet - /** A search suggestion. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @JsonSubTypes( @@ -247,7 +245,7 @@ object Suggestion { case class Module( module: String, documentation: Option[String], - reexports: Set[String] = ListSet() + reexports: Set[String] = Set() ) extends Suggestion with ToLogString { @@ -302,9 +300,9 @@ object Suggestion { name: String, params: Seq[Argument], returnType: String, - parentType: Option[String], - documentation: Option[String], - reexports: Set[String] = ListSet() + parentType: Option[String] = None, + documentation: Option[String] = None, + reexports: Set[String] = Set() ) extends Suggestion with ToLogString { @@ -364,7 +362,7 @@ object Suggestion { returnType: String, documentation: Option[String], annotations: Seq[String], - reexports: Set[String] = ListSet() + reexports: Set[String] = Set() ) extends Suggestion with ToLogString { @@ -451,7 +449,7 @@ object Suggestion { returnType: String, documentation: Option[String], annotations: Seq[String], - reexports: Set[String] = ListSet() + reexports: Set[String] = Set() ) extends Method with ToLogString { @@ -518,7 +516,7 @@ object Suggestion { isStatic: Boolean, documentation: Option[String], annotations: Seq[String], - reexports: Set[String] = ListSet() + reexports: Set[String] = Set() ) extends Method with ToLogString { @@ -576,7 +574,7 @@ object Suggestion { selfType: String, returnType: String, documentation: Option[String], - reexports: Set[String] = ListSet() + reexports: Set[String] = Set() ) extends Method { /** @inheritdoc */ 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 58179ddc1e87..88c9df34caae 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 @@ -5,13 +5,7 @@ import com.fasterxml.jackson.annotation.{ 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 org.enso.common.Serde import org.enso.editions.LibraryName import org.enso.logger.masking.{MaskedPath, MaskedString, ToLogString} import org.enso.pkg.{ComponentGroups, QualifiedName} @@ -25,6 +19,9 @@ import java.nio.ByteBuffer import java.util.UUID import scala.util.Try +import com.github.plokhotnyuk.jsoniter_scala.macros._ +import com.github.plokhotnyuk.jsoniter_scala.core._ + object Runtime { /** A common supertype for all Runtime API methods. @@ -1953,21 +1950,18 @@ object Runtime { 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) - } + import Serde._ + implicit private lazy val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = + JsonCodecMaker.make[ApiEnvelope](Serde.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(mapper.writeValueAsBytes(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. @@ -1976,7 +1970,7 @@ object Runtime { * @return the deserialized message, if the byte buffer can be deserialized. */ def deserializeApiEnvelope(bytes: ByteBuffer): Try[ApiEnvelope] = - Try(mapper.readValue(bytes.array(), classOf[ApiEnvelope])) + Try(readFromByteBuffer[ApiEnvelope](bytes)) } } diff --git a/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala b/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala new file mode 100644 index 000000000000..9637de7881d0 --- /dev/null +++ b/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala @@ -0,0 +1,134 @@ +package org.enso.polyglot.runtime + +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers + +import org.enso.polyglot.Suggestion +import org.enso.polyglot.data.Tree +import Runtime.Api.SuggestionAction +import Runtime.{Api, ApiEnvelope} + +import java.util.UUID + +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.empty, // Set(Suggestion.Argument("foo", "bar", true, false, None, None)), + returnType = "Standard.Base.Data.Set.Set", + parentType = Some("Standard.Base.Any.Any"), + documentation = + None //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.empty, // Set(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 + ) + ) + ) + ) + ) + ) + ) + + val d1 = Api.serialize(message) + val d2 = Api.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 = Api.serialize(libLoaded) + val e2 = Api.deserializeApiEnvelope(e1).get + + libLoaded should equal(e2) + } + +} From 148299a8fb7faa786ad653d7be547cf1977756e3 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 6 Jun 2024 15:03:53 +0200 Subject: [PATCH 03/18] Fix jsoniter integration Turned out that one needs to separate definition site of the serializer from usage so that macros can do the magic properly. --- build.sbt | 20 ++- .../runtime/RuntimeConnector.scala | 6 +- .../enso/polyglot/serde/ApiSerializer.scala | 28 ++++ .../org/enso/polyglot/serde/SerdeSpec.scala | 134 ++++++++++++++++++ .../org/enso/polyglot/runtime/Runtime.scala | 21 +-- .../interpreter/instrument/Endpoint.scala | 7 +- 6 files changed, 189 insertions(+), 27 deletions(-) create mode 100644 engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala create mode 100644 engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala diff --git a/build.sbt b/build.sbt index f8f74164cfe2..8977f55da033 100644 --- a/build.sbt +++ b/build.sbt @@ -283,6 +283,7 @@ lazy val enso = (project in file(".")) `json-rpc-server`, `language-server`, `polyglot-api`, + `polyglot-api-serde`, `project-manager`, `syntax-definition`, `syntax-rust-definition`, @@ -1450,7 +1451,7 @@ lazy val `polyglot-api` = project "com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion, "io.circe" %% "circe-core" % circeVersion, "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.5" % "provided", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.5", "org.scalatest" %% "scalatest" % scalatestVersion % Test, "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ), @@ -1464,6 +1465,20 @@ lazy val `polyglot-api` = project .dependsOn(`logging-utils`) .dependsOn(testkit % Test) +lazy val `polyglot-api-serde` = project + .in(file("engine/polyglot-api-serde")) + .settings( + frgaalJavaCompilerSetting, + Test / fork := true, + commands += WithDebugCommand.withDebug, + libraryDependencies ++= Seq( + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", + "org.scalatest" %% "scalatest" % scalatestVersion % Test, + "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test + ), + ) + .dependsOn(`polyglot-api`) + lazy val `language-server` = (project in file("engine/language-server")) .enablePlugins(JPMSPlugin) .settings( @@ -1608,6 +1623,7 @@ lazy val `language-server` = (project in file("engine/language-server")) .dependsOn(`logging-utils-akka`) .dependsOn(`logging-service`) .dependsOn(`polyglot-api`) + .dependsOn(`polyglot-api-serde`) .dependsOn(`searcher`) .dependsOn(`text-buffer`) .dependsOn(`version-output`) @@ -1870,6 +1886,7 @@ lazy val runtime = (project in file("engine/runtime")) .dependsOn(`library-manager`) .dependsOn(`logging-truffle-connector`) .dependsOn(`polyglot-api`) + .dependsOn(`polyglot-api-serde`) .dependsOn(`text-buffer`) .dependsOn(`runtime-compiler`) .dependsOn(`runtime-suggestions`) @@ -2519,6 +2536,7 @@ lazy val `engine-runner` = project .dependsOn(`logging-service`) .dependsOn(`logging-service-logback` % Runtime) .dependsOn(`polyglot-api`) + .dependsOn(`polyglot-api-serde`) lazy val buildSmallJdk = taskKey[File]("Build a minimal JDK used for native image generation") 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 5e355252d95a..cb6e327306d9 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.serde.ApiSerializer 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(ApiSerializer.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 { + ApiSerializer.deserializeApiEnvelope(data) match { case Success(msg) => actor ! MessageFromRuntime(msg) case Failure(ex) => diff --git a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala new file mode 100644 index 000000000000..c4125efc3b72 --- /dev/null +++ b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala @@ -0,0 +1,28 @@ +package org.enso.polyglot.serde + +import org.enso.polyglot.runtime.Runtime.ApiEnvelope +import java.nio.ByteBuffer +import com.github.plokhotnyuk.jsoniter_scala.core._ + +import scala.util.Try + +object ApiSerializer { + + /** 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-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala new file mode 100644 index 000000000000..f207c8011e7c --- /dev/null +++ b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala @@ -0,0 +1,134 @@ +package org.enso.polyglot.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.empty, // Set(Suggestion.Argument("foo", "bar", true, false, None, None)), + returnType = "Standard.Base.Data.Set.Set", + parentType = Some("Standard.Base.Any.Any"), + documentation = + None //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.empty, // Set(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 + ) + ) + ) + ) + ) + ) + ) + + val d1 = ApiSerializer.serialize(message) + val d2 = ApiSerializer.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 = ApiSerializer.serialize(libLoaded) + val e2 = ApiSerializer.deserializeApiEnvelope(e1).get + + libLoaded should equal(e2) + } + +} 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 88c9df34caae..e871c3bd344d 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 @@ -15,9 +15,7 @@ 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 import com.github.plokhotnyuk.jsoniter_scala.macros._ import com.github.plokhotnyuk.jsoniter_scala.core._ @@ -1951,26 +1949,9 @@ object Runtime { extends ApiResponse import Serde._ - implicit private lazy val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = + implicit lazy val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = JsonCodecMaker.make[ApiEnvelope](Serde.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/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 e92da20167ed..f199cb4242b8 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.serde.ApiSerializer 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(ApiSerializer.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(ApiSerializer.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 { + ApiSerializer.deserializeApiEnvelope(data).foreach { case request: Api.Request => handler.onMessage(request) case response: Api.Response => From d7d3485410cad5fc3fd8b511d395a2bf4615606c Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 6 Jun 2024 15:39:35 +0200 Subject: [PATCH 04/18] fmt --- build.sbt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 8977f55da033..bfc19ee3201e 100644 --- a/build.sbt +++ b/build.sbt @@ -1472,10 +1472,10 @@ lazy val `polyglot-api-serde` = project Test / fork := true, commands += WithDebugCommand.withDebug, libraryDependencies ++= Seq( - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", - "org.scalatest" %% "scalatest" % scalatestVersion % Test, - "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test - ), + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", + "org.scalatest" %% "scalatest" % scalatestVersion % Test, + "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test + ) ) .dependsOn(`polyglot-api`) From f1246fda416f2113f2e2028ed2a71309646427ab Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 6 Jun 2024 17:30:51 +0200 Subject: [PATCH 05/18] package renaming --- .../org/enso/languageserver/runtime/RuntimeConnector.scala | 2 +- .../org/enso/polyglot/{ => runtime}/serde/ApiSerializer.scala | 2 +- .../scala/org/enso/polyglot/{ => runtime}/serde/SerdeSpec.scala | 2 +- .../main/scala/org/enso/interpreter/instrument/Endpoint.scala | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/{ => runtime}/serde/ApiSerializer.scala (95%) rename engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/{ => runtime}/serde/SerdeSpec.scala (99%) 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 cb6e327306d9..ce244c76c1d5 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,7 +13,7 @@ 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.serde.ApiSerializer +import org.enso.polyglot.runtime.serde.ApiSerializer import org.graalvm.polyglot.io.MessageEndpoint import java.nio.ByteBuffer diff --git a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerializer.scala similarity index 95% rename from engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala rename to engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerializer.scala index c4125efc3b72..96c2d0289fe3 100644 --- a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/serde/ApiSerializer.scala +++ b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerializer.scala @@ -1,4 +1,4 @@ -package org.enso.polyglot.serde +package org.enso.polyglot.runtime.serde import org.enso.polyglot.runtime.Runtime.ApiEnvelope import java.nio.ByteBuffer diff --git a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala similarity index 99% rename from engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala rename to engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala index f207c8011e7c..977efe8815a2 100644 --- a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/serde/SerdeSpec.scala +++ b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala @@ -1,4 +1,4 @@ -package org.enso.polyglot.serde +package org.enso.polyglot.runtime.serde import java.util.UUID 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 f199cb4242b8..e92502d331e3 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,7 +5,7 @@ import org.enso.lockmanager.client.{ RuntimeServerRequestHandler } import org.enso.polyglot.runtime.Runtime.{Api, ApiRequest, ApiResponse} -import org.enso.polyglot.serde.ApiSerializer +import org.enso.polyglot.runtime.serde.ApiSerializer import org.graalvm.polyglot.io.MessageEndpoint import java.nio.ByteBuffer From 3369a0b20cd5d14bca054e61998839b1907c7815 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 6 Jun 2024 17:42:17 +0200 Subject: [PATCH 06/18] fix tests --- .../org/enso/polyglot/runtime/SerdeSpec.scala | 134 ------------------ .../instrument/RuntimeServerEmulator.scala | 7 +- 2 files changed, 4 insertions(+), 137 deletions(-) delete mode 100644 engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala diff --git a/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala b/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala deleted file mode 100644 index 9637de7881d0..000000000000 --- a/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/SerdeSpec.scala +++ /dev/null @@ -1,134 +0,0 @@ -package org.enso.polyglot.runtime - -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers - -import org.enso.polyglot.Suggestion -import org.enso.polyglot.data.Tree -import Runtime.Api.SuggestionAction -import Runtime.{Api, ApiEnvelope} - -import java.util.UUID - -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.empty, // Set(Suggestion.Argument("foo", "bar", true, false, None, None)), - returnType = "Standard.Base.Data.Set.Set", - parentType = Some("Standard.Base.Any.Any"), - documentation = - None //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.empty, // Set(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 - ) - ) - ) - ) - ) - ) - ) - - val d1 = Api.serialize(message) - val d2 = Api.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 = Api.serialize(libLoaded) - val e2 = Api.deserializeApiEnvelope(e1).get - - libLoaded should equal(e2) - } - -} 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 a4a907112625..d3e7c41b091d 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.ApiSerializer 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(ApiSerializer.serialize(response)) } ) ) /** Sends a message to the runtime. */ def sendToRuntime(msg: Api.Request): Unit = - endpoint.sendBinary(Api.serialize(msg)) + endpoint.sendBinary(ApiSerializer.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 { + ApiSerializer.deserializeApiEnvelope(data) match { case Success(request: Api.Request) => connector ! request case Success(response: Api.Response) => From 926c77eaff6ac418fc7dffc090140db3fe82d107 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 6 Jun 2024 18:07:28 +0200 Subject: [PATCH 07/18] one more rename --- .../enso/languageserver/runtime/RuntimeConnector.scala | 6 +++--- .../runtime/serde/{ApiSerializer.scala => ApiSerde.scala} | 2 +- .../scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala | 8 ++++---- .../scala/org/enso/interpreter/instrument/Endpoint.scala | 8 ++++---- .../test/instrument/RuntimeServerEmulator.scala | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) rename engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/{ApiSerializer.scala => ApiSerde.scala} (97%) 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 ce244c76c1d5..8c0fc7b872d8 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,7 +13,7 @@ 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.ApiSerializer +import org.enso.polyglot.runtime.serde.ApiSerde import org.graalvm.polyglot.io.MessageEndpoint import java.nio.ByteBuffer @@ -90,7 +90,7 @@ final class RuntimeConnector( context.stop(self) case msg: Runtime.ApiEnvelope => - engine.sendBinary(ApiSerializer.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 = - ApiSerializer.deserializeApiEnvelope(data) match { + ApiSerde.deserializeApiEnvelope(data) match { case Success(msg) => actor ! MessageFromRuntime(msg) case Failure(ex) => diff --git a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerializer.scala b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala similarity index 97% rename from engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerializer.scala rename to engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala index 96c2d0289fe3..e938104e82e4 100644 --- a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerializer.scala +++ b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala @@ -6,7 +6,7 @@ import com.github.plokhotnyuk.jsoniter_scala.core._ import scala.util.Try -object ApiSerializer { +object ApiSerde { /** Serializes an ApiEnvelope into a byte buffer. * diff --git a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala index 977efe8815a2..36cbcc0276ec 100644 --- a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala +++ b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala @@ -108,8 +108,8 @@ class SerdeSpec extends AnyFlatSpec with Matchers { ) ) - val d1 = ApiSerializer.serialize(message) - val d2 = ApiSerializer.deserializeApiEnvelope(d1).get + val d1 = ApiSerde.serialize(message) + val d2 = ApiSerde.deserializeApiEnvelope(d1).get message should equal(d2) @@ -125,8 +125,8 @@ class SerdeSpec extends AnyFlatSpec with Matchers { ) ) ) - val e1 = ApiSerializer.serialize(libLoaded) - val e2 = ApiSerializer.deserializeApiEnvelope(e1).get + 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 e92502d331e3..f5b1efbbc612 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,7 +5,7 @@ import org.enso.lockmanager.client.{ RuntimeServerRequestHandler } import org.enso.polyglot.runtime.Runtime.{Api, ApiRequest, ApiResponse} -import org.enso.polyglot.runtime.serde.ApiSerializer +import org.enso.polyglot.runtime.serde.ApiSerde import org.graalvm.polyglot.io.MessageEndpoint import java.nio.ByteBuffer @@ -21,7 +21,7 @@ class Endpoint(handler: Handler) */ private val reverseRequestEndpoint = new RuntimeServerRequestHandler { override def sendToClient(request: Api.Request): Unit = - client.sendBinary(ApiSerializer.serialize(request)) + client.sendBinary(ApiSerde.serialize(request)) } var client: MessageEndpoint = _ @@ -37,7 +37,7 @@ class Endpoint(handler: Handler) * @param msg the message to send. */ def sendToClient(msg: Api.Response): Unit = - client.sendBinary(ApiSerializer.serialize(msg)) + client.sendBinary(ApiSerde.serialize(msg)) /** Sends a notification to the runtime. * @@ -55,7 +55,7 @@ class Endpoint(handler: Handler) override def sendText(text: String): Unit = {} override def sendBinary(data: ByteBuffer): Unit = - ApiSerializer.deserializeApiEnvelope(data).foreach { + ApiSerde.deserializeApiEnvelope(data).foreach { case request: Api.Request => handler.onMessage(request) case response: Api.Response => 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 d3e7c41b091d..90be3a5ea1ed 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,7 +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.ApiSerializer +import org.enso.polyglot.runtime.serde.ApiSerde import org.graalvm.polyglot.io.{MessageEndpoint, MessageTransport} import java.nio.ByteBuffer @@ -47,13 +47,13 @@ class RuntimeServerEmulator( private val connector = system.actorOf( TestRuntimeServerConnector.props( lockManagerService, - { response => endpoint.sendBinary(ApiSerializer.serialize(response)) } + { response => endpoint.sendBinary(ApiSerde.serialize(response)) } ) ) /** Sends a message to the runtime. */ def sendToRuntime(msg: Api.Request): Unit = - endpoint.sendBinary(ApiSerializer.serialize(msg)) + endpoint.sendBinary(ApiSerde.serialize(msg)) /** Creates a [[MessageTransport]] that should be provided when building the * context. @@ -65,7 +65,7 @@ class RuntimeServerEmulator( override def sendText(text: String): Unit = {} override def sendBinary(data: ByteBuffer): Unit = { - ApiSerializer.deserializeApiEnvelope(data) match { + ApiSerde.deserializeApiEnvelope(data) match { case Success(request: Api.Request) => connector ! request case Success(response: Api.Response) => From fdb11be5bc0fe09a9048e53fb96816f6a22c6c73 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Fri, 7 Jun 2024 17:15:40 +0200 Subject: [PATCH 08/18] Workaround nested option values jsoniter issue When having nested option string values, decoders and encoders don't seem to match under certain conditions. Added an option to skip the values instead, which appears to remedy the problems. Moving projects around to properly setup macros. --- build.sbt | 33 +++++++++++-------- .../enso/polyglot/macros/SerdeConfig.scala} | 16 ++++++--- .../polyglot/runtime/serde/ApiSerde.scala | 8 +++++ .../polyglot/runtime/serde/SerdeSpec.scala | 13 +++++--- .../scala/org/enso/polyglot/Suggestion.scala | 2 +- .../org/enso/polyglot/runtime/Runtime.scala | 9 +---- 6 files changed, 50 insertions(+), 31 deletions(-) rename engine/{common/src/main/scala/org/enso/common/Serde.scala => polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala} (83%) diff --git a/build.sbt b/build.sbt index bfc19ee3201e..7d0a8c86abc7 100644 --- a/build.sbt +++ b/build.sbt @@ -564,6 +564,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 ===================================================== @@ -1420,11 +1421,8 @@ 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", - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.5" % "provided" + "org.graalvm.polyglot" % "polyglot" % graalMavenPackagesVersion % "provided" ) ) .dependsOn(testkit % Test) @@ -1446,14 +1444,12 @@ 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, - "io.circe" %% "circe-core" % circeVersion, - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.28.5", - "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.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion, + "io.circe" %% "circe-core" % circeVersion, + "org.scalatest" %% "scalatest" % scalatestVersion % Test, + "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ), libraryDependencies ++= jackson, GenerateFlatbuffers.flatcVersion := flatbuffersVersion, @@ -1465,6 +1461,16 @@ lazy val `polyglot-api` = project .dependsOn(`logging-utils`) .dependsOn(testkit % Test) +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, + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion + ) + ) + lazy val `polyglot-api-serde` = project .in(file("engine/polyglot-api-serde")) .settings( @@ -1472,12 +1478,13 @@ lazy val `polyglot-api-serde` = project Test / fork := true, commands += WithDebugCommand.withDebug, libraryDependencies ++= Seq( - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.28.5", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion, "org.scalatest" %% "scalatest" % scalatestVersion % Test, "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ) ) .dependsOn(`polyglot-api`) + .dependsOn(`polyglot-api-macros`) lazy val `language-server` = (project in file("engine/language-server")) .enablePlugins(JPMSPlugin) diff --git a/engine/common/src/main/scala/org/enso/common/Serde.scala b/engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala similarity index 83% rename from engine/common/src/main/scala/org/enso/common/Serde.scala rename to engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala index 558aeedd3ad3..9a42cb4d564a 100644 --- a/engine/common/src/main/scala/org/enso/common/Serde.scala +++ b/engine/polyglot-api-macros/src/main/scala/org/enso/polyglot/macros/SerdeConfig.scala @@ -1,17 +1,22 @@ -package org.enso.common - +package org.enso.polyglot.macros import com.github.plokhotnyuk.jsoniter_scala.macros._ import com.github.plokhotnyuk.jsoniter_scala.core._ import java.io.File - -object Serde { - +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 + */ val config = CodecMakerConfig .withAllowRecursiveTypes(allowRecursiveTypes = true) .withRequireCollectionFields(requireCollectionFields = true) .withTransientEmpty(false) + .withSkipNestedOptionValues(true) implicit lazy val fileCodec: JsonValueCodec[File] = new JsonValueCodec[File] { override def decodeValue(in: JsonReader, default: File): File = { @@ -54,4 +59,5 @@ object Serde { override def nullValue: File = null } + } diff --git a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala index e938104e82e4..601af3c555f2 100644 --- a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala +++ b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala @@ -4,10 +4,18 @@ import org.enso.polyglot.runtime.Runtime.ApiEnvelope import java.nio.ByteBuffer import com.github.plokhotnyuk.jsoniter_scala.core._ +import org.enso.polyglot.macros.SerdeConfig +import com.github.plokhotnyuk.jsoniter_scala.macros._ + import scala.util.Try object ApiSerde { + import SerdeConfig._ + + implicit val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = + JsonCodecMaker.make[ApiEnvelope](config) + /** Serializes an ApiEnvelope into a byte buffer. * * @param message the message to serialize. diff --git a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala index 36cbcc0276ec..4924d85d275f 100644 --- a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala +++ b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala @@ -75,7 +75,7 @@ class SerdeSpec extends AnyFlatSpec with Matchers { returnType = "Standard.Base.Data.Set.Set", parentType = Some("Standard.Base.Any.Any"), documentation = - None //Some(" An unordered collection of unique values") + Some(" An unordered collection of unique values") //reexports = Set("foo") ), action = SuggestionAction.Modify(documentation = Some(None)) @@ -89,15 +89,20 @@ class SerdeSpec extends AnyFlatSpec with Matchers { externalId = Some(UUID.randomUUID()), module = "Standard.Base.Data.Vector", name = "Set", - params = - Seq.empty, // Set(Suggestion.Argument("foo", "bar", true, false, None, None)), + 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)) + action = SuggestionAction.Modify( + documentation = Some(None), + returnType = Some("foo") + ) ), children = Vector.empty ) 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 e7a88b90023d..d0621719dff0 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 @@ -300,7 +300,7 @@ object Suggestion { name: String, params: Seq[Argument], returnType: String, - parentType: Option[String] = None, + parentType: Option[String], documentation: Option[String] = None, reexports: Set[String] = Set() ) extends Suggestion 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 e871c3bd344d..13b6476ad0a3 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 @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.{ JsonSubTypes, JsonTypeInfo } -import org.enso.common.Serde + import org.enso.editions.LibraryName import org.enso.logger.masking.{MaskedPath, MaskedString, ToLogString} import org.enso.pkg.{ComponentGroups, QualifiedName} @@ -17,9 +17,6 @@ import org.enso.text.editing.model.{Range, TextEdit} import java.io.File import java.util.UUID -import com.github.plokhotnyuk.jsoniter_scala.macros._ -import com.github.plokhotnyuk.jsoniter_scala.core._ - object Runtime { /** A common supertype for all Runtime API methods. @@ -1948,10 +1945,6 @@ object Runtime { final case class SetExecutionEnvironmentResponse(contextId: ContextId) extends ApiResponse - import Serde._ - implicit lazy val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = - JsonCodecMaker.make[ApiEnvelope](Serde.config) - } } From 40e84acc21c9a8a5a85343779fa4af49e34c03d6 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Fri, 7 Jun 2024 18:07:45 +0200 Subject: [PATCH 09/18] nits --- .../enso/polyglot/macros/SerdeConfig.scala | 30 +++---------------- .../polyglot/runtime/serde/SerdeSpec.scala | 10 ++++--- .../scala/org/enso/polyglot/Suggestion.scala | 15 +++++----- 3 files changed, 18 insertions(+), 37 deletions(-) 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 index 9a42cb4d564a..3a5ceb571311 100644 --- 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 @@ -23,38 +23,16 @@ object SerdeConfig { val t = in.nextToken() if (t == 'n') in.readNullOrError(null, "expected 'null' or JSON value") - else if (t == '"') { + else { in.rollbackToken() val path = in.readString(null) - if (path == null) null - else new File(path) - } else if (t == '{') { - if (!in.isNextToken('}')) { - in.rollbackToken() - val key = in.readKeyAsString() - if (key != "file") { - throw new RuntimeException("invalid field name, expected `file` got `" + key + "`") - } - val path = in.readString(null) - if (!in.isNextToken('}')) { - in.objectEndOrCommaError() - } - new File(path) - } else { - null - } - - } else throw new RuntimeException("Invalid value, cannot deserialize at " + t) + new File(path) + } } override def encodeValue(x: File, out: JsonWriter): Unit = { - out.writeObjectStart() if (x == null) out.writeNull() - else { - out.writeKey("file") - out.writeVal(x.getPath) - } - out.writeObjectEnd() + else out.writeVal(x.getPath) } override def nullValue: File = null diff --git a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala index 4924d85d275f..b976007575bb 100644 --- a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala +++ b/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala @@ -70,13 +70,15 @@ class SerdeSpec extends AnyFlatSpec with Matchers { externalId = Some(UUID.randomUUID()), module = "Standard.Base.Data.Set", name = "Set", - params = - Seq.empty, // Set(Suggestion.Argument("foo", "bar", true, false, None, None)), + 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") + Some(" An unordered collection of unique values"), + reexports = Set("foo") ), action = SuggestionAction.Modify(documentation = Some(None)) ), 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 d0621719dff0..1d9a3d61a99e 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 @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.{JsonIgnore, JsonSubTypes, JsonTypeInfo} import org.enso.logger.masking.ToLogString import java.util.UUID +import scala.collection.immutable.ListSet /** A search suggestion. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @@ -245,7 +246,7 @@ object Suggestion { case class Module( module: String, documentation: Option[String], - reexports: Set[String] = Set() + reexports: Set[String] = ListSet() ) extends Suggestion with ToLogString { @@ -301,8 +302,8 @@ object Suggestion { params: Seq[Argument], returnType: String, parentType: Option[String], - documentation: Option[String] = None, - reexports: Set[String] = Set() + documentation: Option[String], + reexports: Set[String] = ListSet() ) extends Suggestion with ToLogString { @@ -362,7 +363,7 @@ object Suggestion { returnType: String, documentation: Option[String], annotations: Seq[String], - reexports: Set[String] = Set() + reexports: Set[String] = ListSet() ) extends Suggestion with ToLogString { @@ -449,7 +450,7 @@ object Suggestion { returnType: String, documentation: Option[String], annotations: Seq[String], - reexports: Set[String] = Set() + reexports: Set[String] = ListSet() ) extends Method with ToLogString { @@ -516,7 +517,7 @@ object Suggestion { isStatic: Boolean, documentation: Option[String], annotations: Seq[String], - reexports: Set[String] = Set() + reexports: Set[String] = ListSet() ) extends Method with ToLogString { @@ -574,7 +575,7 @@ object Suggestion { selfType: String, returnType: String, documentation: Option[String], - reexports: Set[String] = Set() + reexports: Set[String] = ListSet() ) extends Method { /** @inheritdoc */ From 6f27c52be5da9f346427da3fa7d830337cb8ee79 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Mon, 10 Jun 2024 13:48:52 +0200 Subject: [PATCH 10/18] Drop jackson annotations --- build.sbt | 14 +- .../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 | 607 ++++-------------- .../compiler/test/context/JacksonTest.java | 74 --- 9 files changed, 146 insertions(+), 771 deletions(-) delete mode 100644 engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/context/JacksonTest.java diff --git a/build.sbt b/build.sbt index 7d0a8c86abc7..233a284e6fb3 100644 --- a/build.sbt +++ b/build.sbt @@ -1444,14 +1444,13 @@ 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, - "io.circe" %% "circe-core" % circeVersion, - "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 % "provided", + "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 ) @@ -1479,6 +1478,7 @@ lazy val `polyglot-api-serde` = project commands += WithDebugCommand.withDebug, libraryDependencies ++= Seq( "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion, + "io.circe" %% "circe-yaml" % circeYamlVersion % "provided", // as required by `pkg` and `editions` "org.scalatest" %% "scalatest" % scalatestVersion % Test, "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test ) 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 078e8f388473..5bc5a9129595 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 243ccdb9858c..877b2474d05d 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 1d9a3d61a99e..dda9cea1b712 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,49 +1,12 @@ 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 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" - ) - ) -) @SerialVersionUID(9650L) sealed trait Suggestion extends ToLogString { @@ -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 41dd17edc97f..43358f994f36 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 09f589bacecb..1b17be75bf71 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 5d2dda488851..bc48dd3c1361 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 13b6476ad0a3..3f37299bf581 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,11 +1,6 @@ package org.enso.polyglot.runtime -import com.fasterxml.jackson.annotation.{ - JsonIgnoreProperties, - JsonSubTypes, - JsonTypeInfo -} - +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,299 +16,6 @@ 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 @@ -373,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], @@ -411,6 +101,7 @@ object Runtime { } /** A call corresponding to "entering a function call". */ + @named("localCall") case class LocalCall(expressionId: ExpressionId) extends StackItem } @@ -427,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], @@ -439,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 { @@ -468,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 @@ -490,6 +162,7 @@ object Runtime { /** TBD */ + @named("expressionUpdatePayloadPending") case class Pending(message: Option[String], progress: Option[Double]) extends Payload; @@ -497,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. @@ -504,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] @@ -521,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 { @@ -537,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 } @@ -575,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] @@ -586,6 +243,7 @@ object Runtime { * @param contextId a context identifier * @param expressionId an expression identifier */ + @named("visualizationContext") case class VisualizationContext( visualizationId: VisualizationId, contextId: ContextId, @@ -593,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] @@ -619,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, @@ -642,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] @@ -681,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 { @@ -706,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 { @@ -721,6 +352,7 @@ object Runtime { * * @param index the position of the arugment */ + @named("suggestionArgumentActionRemove") case class Remove(index: Int) extends SuggestionArgumentAction { /** @inheritdoc */ @@ -737,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, @@ -760,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 */ @@ -789,6 +406,7 @@ object Runtime { } /** Remove the suggestion. */ + @named("suggestionActionRemove") case class Remove() extends SuggestionAction { /** @inheritdoc */ @@ -805,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, @@ -831,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 { @@ -847,6 +457,7 @@ object Runtime { * * @param module the module name */ + @named("suggestionDatabaseActionClean") case class Clean(module: String) extends SuggestionsDatabaseAction } @@ -855,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 } @@ -891,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 } @@ -935,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. * */ @@ -969,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], @@ -1052,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 { @@ -1068,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 } @@ -1092,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. */ @@ -1122,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 */ @@ -1140,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] @@ -1159,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 @@ -1178,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] @@ -1199,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], @@ -1221,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 @@ -1249,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 @@ -1279,6 +841,7 @@ object Runtime { * * @param contextId the newly created context's id. */ + @named("createContextRequest") final case class CreateContextRequest(contextId: ContextId) extends ApiRequest @@ -1286,6 +849,7 @@ object Runtime { * * @param contextId the newly created context's id. */ + @named("createContextResponse") final case class CreateContextResponse(contextId: ContextId) extends ApiResponse @@ -1294,6 +858,7 @@ object Runtime { * * @param contextId the destroyed context's id. */ + @named("destroyContextRequest") final case class DestroyContextRequest(contextId: ContextId) extends ApiRequest @@ -1302,6 +867,7 @@ object Runtime { * * @param contextId the destroyed context's id */ + @named("destroyContextResponse") final case class DestroyContextResponse(contextId: ContextId) extends ApiResponse @@ -1311,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 @@ -1320,6 +887,7 @@ object Runtime { * * @param contextId the context's id. */ + @named("pushContextResponse") final case class PushContextResponse(contextId: ContextId) extends ApiResponse @@ -1328,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 @@ -1345,6 +915,7 @@ object Runtime { * recomputed. * @param executionEnvironment the environment used for execution */ + @named("recomputeContextRequest") final case class RecomputeContextRequest( contextId: ContextId, expressions: Option[InvalidatedExpressions], @@ -1356,6 +927,7 @@ object Runtime { * * @param contextId the context's id. */ + @named("recomputeContextResponse") final case class RecomputeContextResponse(contextId: ContextId) extends ApiResponse @@ -1364,6 +936,7 @@ object Runtime { * * @param contextId the context's id. */ + @named("interruptContextRequest") final case class InterruptContextRequest(contextId: ContextId) extends ApiRequest @@ -1372,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 @@ -1386,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 @@ -1394,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 @@ -1415,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, @@ -1440,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, @@ -1457,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. @@ -1476,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 @@ -1492,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 @@ -1501,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], @@ -1524,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], @@ -1547,6 +1135,7 @@ object Runtime { * * @param path the file being closed. */ + @named("closeFileNotification") final case class CloseFileNotification(path: File) extends ApiRequest with ToLogString { @@ -1560,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, @@ -1577,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, @@ -1595,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 @@ -1604,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, @@ -1612,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 @@ -1621,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 @@ -1637,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. @@ -1653,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, @@ -1665,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, @@ -1676,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 @@ -1685,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, @@ -1695,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 @@ -1735,6 +1326,7 @@ object Runtime { * * @param module the module name */ + @named("symbolRenameFailedFailedToApplyEdits") final case class FailedToApplyEdits(module: String) extends SymbolRenameFailed.Error @@ -1743,6 +1335,7 @@ object Runtime { * * @param expressionId the id of expression */ + @named("symbolRenameFailedOperationNotSupported") final case class OperationNotSupported(expressionId: ExpressionId) extends SymbolRenameFailed.Error } @@ -1754,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], @@ -1777,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] @@ -1792,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 @@ -1818,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, @@ -1829,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 @@ -1870,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, @@ -1881,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. @@ -1894,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. @@ -1901,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. @@ -1911,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. @@ -1920,28 +1529,34 @@ 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 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 834bab08da2d..000000000000 --- 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) {} -} From 61c6c3b865283db07ffd69589301293ad1b5f434 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Mon, 10 Jun 2024 16:00:11 +0200 Subject: [PATCH 11/18] legal review --- distribution/engine/THIRD-PARTY/NOTICE | 15 +- .../CREDITS-2.x.txt | 145 ------------------ .../LICENSE | 8 - .../NOTICES | 1 - .../NOTICES | 121 --------------- .../project-manager/THIRD-PARTY/NOTICE | 15 -- .../CREDITS-2.x.txt | 145 ------------------ .../LICENSE | 8 - .../NOTICES | 29 ---- .../NOTICES | 121 --------------- .../files-add/CREDITS-2.x.txt | 145 ------------------ .../files-ignore | 2 - .../copyright-ignore | 1 - .../copyright-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 - .../copyright-add | 60 -------- .../copyright-ignore | 9 -- .../copyright-keep-context | 2 - .../custom-license | 1 - .../legal-review/project-manager/report-state | 4 +- 32 files changed, 9 insertions(+), 1080 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 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 delete mode 100644 distribution/project-manager/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES 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/custom-license delete mode 100644 tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/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 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/distribution/engine/THIRD-PARTY/NOTICE b/distribution/engine/THIRD-PARTY/NOTICE index 3bf6c34cac62..5ae8c550cefc 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`. +'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.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 engine. +'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.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-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 71e1f423f691..000000000000 --- 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 2011e3174783..000000000000 --- 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 2aba3b414bd7..000000000000 --- 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.thoughtworks.paranamer.paranamer-2.8/NOTICES b/distribution/engine/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES deleted file mode 100644 index 54a32ab99c72..000000000000 --- 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 a02778150b4b..907d614b5be2 100644 --- a/distribution/project-manager/THIRD-PARTY/NOTICE +++ b/distribution/project-manager/THIRD-PARTY/NOTICE @@ -51,16 +51,6 @@ 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`. - - -'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`. - - 'pureconfig-core_2.13', licensed under the Mozilla Public License, version 2.0, 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.pureconfig.pureconfig-core_2.13-0.17.4`. @@ -86,11 +76,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 71e1f423f691..000000000000 --- 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 2011e3174783..000000000000 --- 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 afd6f5786e98..000000000000 --- 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.thoughtworks.paranamer.paranamer-2.8/NOTICES b/distribution/project-manager/THIRD-PARTY/com.thoughtworks.paranamer.paranamer-2.8/NOTICES deleted file mode 100644 index 54a32ab99c72..000000000000 --- 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/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 71e1f423f691..000000000000 --- 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 26e9c87b6125..000000000000 --- 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 b7498f2ff8de..000000000000 --- 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 2aba3b414bd7..000000000000 --- 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/custom-license b/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/custom-license deleted file mode 100644 index 6b1d0bfabc3c..000000000000 --- a/tools/legal-review/engine/com.fasterxml.jackson.module.jackson-module-scala_2.13-2.15.2/custom-license +++ /dev/null @@ -1 +0,0 @@ -LICENSE 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 b9005a4d5ae7..000000000000 --- 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.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 ba17e72188d1..000000000000 --- 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 4d04b258f4f0..000000000000 --- 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 6814e7da60f6..000000000000 --- 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 663c2fd0902f..000000000000 --- 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 43caea6d554f..278bf56e6d7e 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 71e1f423f691..000000000000 --- 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 26e9c87b6125..000000000000 --- 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 fdb813a69ae3..000000000000 --- 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 b5c5695996a8..000000000000 --- 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 e69de29bb2d1..000000000000 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 b9005a4d5ae7..000000000000 --- 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.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 ba17e72188d1..000000000000 --- 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 4d04b258f4f0..000000000000 --- 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 6814e7da60f6..000000000000 --- 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 663c2fd0902f..000000000000 --- 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 5f2880e97cc8..67d4e0ef3853 100644 --- a/tools/legal-review/project-manager/report-state +++ b/tools/legal-review/project-manager/report-state @@ -1,3 +1,3 @@ -ECE7DA5C5F2AA668330D02E802158890374B9E29D008A9752FDC31B97894A1DC -9C894B66374B5FA85C5ACA368DAAA5934DD295F4233911B5A4CB2B6E46A100B4 +CC52C85EB3795048FB5822DA40782D49879E4D607542852C109523B2AA806313 +5210F77FA25A449A76442AA4628576B6F0ACA9CE2465108ED8769D06EF388238 0 From 3125387e20dcc8eab13c0fd4982b5c83d848323b Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Mon, 10 Jun 2024 16:26:24 +0200 Subject: [PATCH 12/18] missing licensing --- .../LICENSE | 21 +++++++++++++++++++ .../LICENSE | 21 +++++++++++++++++++ .../custom-license | 1 + .../files-keep | 1 + .../custom-license | 1 + .../files-keep | 1 + 6 files changed, 46 insertions(+) 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 create mode 100644 tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license 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 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 000000000000..a33507599b43 --- /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 000000000000..a33507599b43 --- /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/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license b/tools/legal-review/engine/com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5/custom-license new file mode 100644 index 000000000000..6b1d0bfabc3c --- /dev/null +++ b/tools/legal-review/engine/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/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 000000000000..ed345faefcec --- /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 000000000000..6b1d0bfabc3c --- /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 000000000000..ed345faefcec --- /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 From 6733312cfa4d04253d2def0bb2326b782bcbf0dd Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 10:43:47 +0200 Subject: [PATCH 13/18] fmt changes --- .../main/scala/org/enso/polyglot/macros/SerdeConfig.scala | 4 ++-- .../scala/org/enso/polyglot/runtime/serde/ApiSerde.scala | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 index 3a5ceb571311..115a349a3d79 100644 --- 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 @@ -1,7 +1,7 @@ package org.enso.polyglot.macros -import com.github.plokhotnyuk.jsoniter_scala.macros._ -import com.github.plokhotnyuk.jsoniter_scala.core._ +import com.github.plokhotnyuk.jsoniter_scala.macros.CodecMakerConfig +import com.github.plokhotnyuk.jsoniter_scala.core.{JsonValueCodec, JsonReader, JsonWriter} import java.io.File object SerdeConfig { diff --git a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala index 601af3c555f2..16c7f8b5c492 100644 --- a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala +++ b/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala @@ -2,10 +2,14 @@ package org.enso.polyglot.runtime.serde import org.enso.polyglot.runtime.Runtime.ApiEnvelope import java.nio.ByteBuffer -import com.github.plokhotnyuk.jsoniter_scala.core._ +import com.github.plokhotnyuk.jsoniter_scala.core.{ + readFromByteBuffer, + writeToArray, + JsonValueCodec +} import org.enso.polyglot.macros.SerdeConfig -import com.github.plokhotnyuk.jsoniter_scala.macros._ +import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker import scala.util.Try From 35ff3c90796259bf3cd0f928689c58498b869658 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 12:00:38 +0200 Subject: [PATCH 14/18] merge polyglot-api-serde to polyglot-api --- build.sbt | 30 +++++-------------- .../enso/polyglot/macros/SerdeConfig.scala | 2 +- .../polyglot/runtime/serde/ApiSerde.scala | 2 +- .../polyglot/runtime/serde/SerdeSpec.scala | 0 4 files changed, 9 insertions(+), 25 deletions(-) rename engine/{polyglot-api-serde => polyglot-api}/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala (93%) rename engine/{polyglot-api-serde => polyglot-api}/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala (100%) diff --git a/build.sbt b/build.sbt index c249273809b1..81b8c6729cad 100644 --- a/build.sbt +++ b/build.sbt @@ -285,7 +285,7 @@ lazy val enso = (project in file(".")) `json-rpc-server`, `language-server`, `polyglot-api`, - `polyglot-api-serde`, + `polyglot-api-macros`, `project-manager`, `syntax-rust-definition`, `text-buffer`, @@ -1464,7 +1464,9 @@ lazy val `polyglot-api` = project libraryDependencies ++= Seq( "org.graalvm.sdk" % "polyglot-tck" % graalMavenPackagesVersion % "provided", "org.graalvm.truffle" % "truffle-api" % graalMavenPackagesVersion % "provided", - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "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 @@ -1477,33 +1479,18 @@ 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, - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion % "provided", + "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "provided" ) ) -lazy val `polyglot-api-serde` = project - .in(file("engine/polyglot-api-serde")) - .settings( - frgaalJavaCompilerSetting, - Test / fork := true, - commands += WithDebugCommand.withDebug, - libraryDependencies ++= Seq( - "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion, - "io.circe" %% "circe-yaml" % circeYamlVersion % "provided", // as required by `pkg` and `editions` - "org.scalatest" %% "scalatest" % scalatestVersion % Test, - "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test - ) - ) - .dependsOn(`polyglot-api`) - .dependsOn(`polyglot-api-macros`) - lazy val `language-server` = (project in file("engine/language-server")) .enablePlugins(JPMSPlugin) .settings( @@ -1666,7 +1653,6 @@ lazy val `language-server` = (project in file("engine/language-server")) .dependsOn(`logging-utils-akka`) .dependsOn(`logging-service`) .dependsOn(`polyglot-api`) - .dependsOn(`polyglot-api-serde`) .dependsOn(`searcher`) .dependsOn(`text-buffer`) .dependsOn(`version-output`) @@ -1942,7 +1928,6 @@ lazy val runtime = (project in file("engine/runtime")) .dependsOn(`library-manager`) .dependsOn(`logging-truffle-connector`) .dependsOn(`polyglot-api`) - .dependsOn(`polyglot-api-serde`) .dependsOn(`text-buffer`) .dependsOn(`runtime-compiler`) .dependsOn(`runtime-suggestions`) @@ -2677,7 +2662,6 @@ lazy val `engine-runner` = project .dependsOn(`logging-service`) .dependsOn(`logging-service-logback` % Runtime) .dependsOn(`polyglot-api`) - .dependsOn(`polyglot-api-serde`) lazy val buildSmallJdk = taskKey[File]("Build a minimal JDK used for native image generation") 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 index 115a349a3d79..3cc5446e5b1c 100644 --- 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 @@ -18,7 +18,7 @@ object SerdeConfig { .withTransientEmpty(false) .withSkipNestedOptionValues(true) - implicit lazy val fileCodec: JsonValueCodec[File] = new JsonValueCodec[File] { + implicit val fileCodec: JsonValueCodec[File] = new JsonValueCodec[File] { override def decodeValue(in: JsonReader, default: File): File = { val t = in.nextToken() diff --git a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala similarity index 93% rename from engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala rename to engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala index 16c7f8b5c492..ad88208dbbc2 100644 --- a/engine/polyglot-api-serde/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala +++ b/engine/polyglot-api/src/main/scala/org/enso/polyglot/runtime/serde/ApiSerde.scala @@ -17,7 +17,7 @@ object ApiSerde { import SerdeConfig._ - implicit val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = + private implicit val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = JsonCodecMaker.make[ApiEnvelope](config) /** Serializes an ApiEnvelope into a byte buffer. diff --git a/engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala b/engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala similarity index 100% rename from engine/polyglot-api-serde/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala rename to engine/polyglot-api/src/test/scala/org/enso/polyglot/runtime/serde/SerdeSpec.scala From da7252ba1e90ecb983fad138dc8c73ff552b74be Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 12:24:54 +0200 Subject: [PATCH 15/18] fmt --- .../scala/org/enso/polyglot/macros/SerdeConfig.scala | 11 ++++++++--- .../org/enso/polyglot/runtime/serde/ApiSerde.scala | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) 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 index 3cc5446e5b1c..fbbfde01a47b 100644 --- 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 @@ -1,16 +1,21 @@ package org.enso.polyglot.macros import com.github.plokhotnyuk.jsoniter_scala.macros.CodecMakerConfig -import com.github.plokhotnyuk.jsoniter_scala.core.{JsonValueCodec, JsonReader, JsonWriter} +import com.github.plokhotnyuk.jsoniter_scala.core.{ + JsonReader, + JsonValueCodec, + JsonWriter +} import java.io.File object SerdeConfig { - /** - * Custom configuration for generating jsoniter's codecs. + /** 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) 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 index ad88208dbbc2..385dc413d187 100644 --- 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 @@ -17,7 +17,7 @@ object ApiSerde { import SerdeConfig._ - private implicit val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = + implicit private val apiEnvelopeCodec: JsonValueCodec[ApiEnvelope] = JsonCodecMaker.make[ApiEnvelope](config) /** Serializes an ApiEnvelope into a byte buffer. From e46b4c545fd6c8cc8bd911862f13a46ea0ea8c74 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 13:47:21 +0200 Subject: [PATCH 16/18] licensing --- distribution/project-manager/THIRD-PARTY/NOTICE | 8 ++++++++ tools/legal-review/project-manager/report-state | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/distribution/project-manager/THIRD-PARTY/NOTICE b/distribution/project-manager/THIRD-PARTY/NOTICE index 907d614b5be2..8aac074b0104 100644 --- a/distribution/project-manager/THIRD-PARTY/NOTICE +++ b/distribution/project-manager/THIRD-PARTY/NOTICE @@ -51,6 +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`. +'jsoniter-scala-core_2.13', licensed under the MIT License, is distributed with the project-manager. +The license file can be found at `licenses/MIT`. + + +'jsoniter-scala-macros_2.13', licensed under the MIT License, is distributed with the project-manager. +The license file can be found at `licenses/MIT`. + + 'pureconfig-core_2.13', licensed under the Mozilla Public License, version 2.0, 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.pureconfig.pureconfig-core_2.13-0.17.4`. diff --git a/tools/legal-review/project-manager/report-state b/tools/legal-review/project-manager/report-state index 67d4e0ef3853..bc211dc0695b 100644 --- a/tools/legal-review/project-manager/report-state +++ b/tools/legal-review/project-manager/report-state @@ -1,3 +1,3 @@ -CC52C85EB3795048FB5822DA40782D49879E4D607542852C109523B2AA806313 -5210F77FA25A449A76442AA4628576B6F0ACA9CE2465108ED8769D06EF388238 -0 +482FAAF233FCF62EB6FC44FEC957DC79001FF33F15D640C542A03482F452C982 +BB80AE3573E470A1F5C6DBAE4637A81F5F4816A2D4A0D04087D470B4E1CF0B4D +4 From 27794068f72eb696b8c27001a2c992af0d9ff0e3 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 14:40:28 +0200 Subject: [PATCH 17/18] ditch jackson, only used in tests --- build.sbt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.sbt b/build.sbt index 81b8c6729cad..29b652daab72 100644 --- a/build.sbt +++ b/build.sbt @@ -481,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 ================================================================ From 6ed4b4601c2f4fbf7a9edf2f12a2ab974da9854d Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 11 Jun 2024 14:51:11 +0200 Subject: [PATCH 18/18] missed licensing issues in PM --- .../project-manager/THIRD-PARTY/NOTICE | 6 ++++-- .../LICENSE | 21 +++++++++++++++++++ .../LICENSE | 21 +++++++++++++++++++ .../custom-license | 1 + .../files-keep | 1 + .../custom-license | 1 + .../files-keep | 1 + .../legal-review/project-manager/report-state | 4 ++-- 8 files changed, 52 insertions(+), 4 deletions(-) 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 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 diff --git a/distribution/project-manager/THIRD-PARTY/NOTICE b/distribution/project-manager/THIRD-PARTY/NOTICE index 8aac074b0104..6533aeb124e8 100644 --- a/distribution/project-manager/THIRD-PARTY/NOTICE +++ b/distribution/project-manager/THIRD-PARTY/NOTICE @@ -52,11 +52,13 @@ Copyright notices related to this dependency can be found in the directory `com. 'jsoniter-scala-core_2.13', licensed under the MIT License, is distributed with the project-manager. -The license file can be found at `licenses/MIT`. +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`. 'jsoniter-scala-macros_2.13', licensed under the MIT License, is distributed with the project-manager. -The license file can be found at `licenses/MIT`. +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. 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 000000000000..a33507599b43 --- /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 000000000000..a33507599b43 --- /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/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 000000000000..6b1d0bfabc3c --- /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 000000000000..ed345faefcec --- /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 000000000000..6b1d0bfabc3c --- /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 000000000000..ed345faefcec --- /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/report-state b/tools/legal-review/project-manager/report-state index bc211dc0695b..c025470e934f 100644 --- a/tools/legal-review/project-manager/report-state +++ b/tools/legal-review/project-manager/report-state @@ -1,3 +1,3 @@ 482FAAF233FCF62EB6FC44FEC957DC79001FF33F15D640C542A03482F452C982 -BB80AE3573E470A1F5C6DBAE4637A81F5F4816A2D4A0D04087D470B4E1CF0B4D -4 +707A702E516A641673B26AAD1F4BC35919B4DBB0C3E3D76BD032C3FF2A54A8D7 +0