From c40dc46597e9210cae6965f9851009b1a19301d1 Mon Sep 17 00:00:00 2001 From: Thomas Pani Date: Thu, 23 Nov 2023 14:01:59 +0100 Subject: [PATCH] Upgrade dependencies to Guice 7 (#2781) * Upgrade to guice 6 * Upgrade to guice 7 Guice 7 dropped support for `javax.inject.*` in favor of `jakarta.inject.*`: https://github.com/google/guice/wiki/Guice700#jee-jakarta-transition Since we do not want to pull in Java EE, we're switching to the properietary `com.google` package. --- .../at/forsyte/apalache/infra/DefaultExceptionAdapter.scala | 2 +- project/Dependencies.scala | 2 +- .../apalache/tla/bmcmt/config/CheckerExceptionAdapter.scala | 3 +-- .../at/forsyte/apalache/tla/imp/ParserExceptionAdapter.scala | 2 +- .../src/main/scala/at/forsyte/apalache/tla/pp/Desugarer.scala | 2 +- .../main/scala/at/forsyte/apalache/tla/pp/ExprOptimizer.scala | 3 +-- .../main/scala/at/forsyte/apalache/tla/pp/Keramelizer.scala | 2 +- .../src/main/scala/at/forsyte/apalache/tla/pp/Normalizer.scala | 2 +- .../scala/at/forsyte/apalache/tla/pp/TypeSubstitutor.scala | 2 +- .../at/forsyte/apalache/tla/pp/temporal/LoopEncoder.scala | 2 +- .../at/forsyte/apalache/tla/pp/temporal/TableauEncoder.scala | 2 +- .../tla/lir/transformations/standard/IncrementalRenaming.scala | 2 +- 12 files changed, 12 insertions(+), 14 deletions(-) diff --git a/mod-infra/src/main/scala/at/forsyte/apalache/infra/DefaultExceptionAdapter.scala b/mod-infra/src/main/scala/at/forsyte/apalache/infra/DefaultExceptionAdapter.scala index 54cf165249..642fcaed1d 100644 --- a/mod-infra/src/main/scala/at/forsyte/apalache/infra/DefaultExceptionAdapter.scala +++ b/mod-infra/src/main/scala/at/forsyte/apalache/infra/DefaultExceptionAdapter.scala @@ -1,6 +1,6 @@ package at.forsyte.apalache.infra -import javax.inject.Singleton +import com.google.inject.Singleton /** * The default adapter does nothing. diff --git a/project/Dependencies.scala b/project/Dependencies.scala index da63ec9579..af6921faf9 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -22,7 +22,7 @@ object Dependencies { "commons-beanutils" % "commons-beanutils" % "1.9.4" // Apparently an untracked dependency of commonsConfiguration2 val commonsConfiguration2 = "org.apache.commons" % "commons-configuration2" % "2.9.0" val commonsIo = "commons-io" % "commons-io" % "2.15.0" - val guice = "com.google.inject" % "guice" % "5.1.0" + val guice = "com.google.inject" % "guice" % "7.0.0" val kiama = "org.bitbucket.inkytonik.kiama" %% "kiama" % "2.5.1" val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion val logbackCore = "ch.qos.logback" % "logback-core" % logbackVersion diff --git a/tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/config/CheckerExceptionAdapter.scala b/tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/config/CheckerExceptionAdapter.scala index b75c5141e0..bad9234a93 100644 --- a/tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/config/CheckerExceptionAdapter.scala +++ b/tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/config/CheckerExceptionAdapter.scala @@ -14,10 +14,9 @@ import at.forsyte.apalache.tla.lir.{ } import at.forsyte.apalache.tla.pp.{IrrecoverablePreprocessingError, NotInKeraError, OverridingError, TlaInputError} import at.forsyte.apalache.tla.typecheck.TypingInputException +import com.google.inject.{Inject, Singleton} import com.typesafe.scalalogging.LazyLogging -import javax.inject.{Inject, Singleton} - /** * The adapter for all exceptions that can be produced when running the model checker. * diff --git a/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/ParserExceptionAdapter.scala b/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/ParserExceptionAdapter.scala index 2bb5268504..18a1d7ec9a 100644 --- a/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/ParserExceptionAdapter.scala +++ b/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/ParserExceptionAdapter.scala @@ -3,7 +3,7 @@ package at.forsyte.apalache.tla.imp import at.forsyte.apalache.infra.ExceptionAdapter import com.typesafe.scalalogging.LazyLogging -import javax.inject.{Inject, Singleton} +import com.google.inject.{Inject, Singleton} // TODO: This can be removed in theory, but our current architecture requires executable passes // include a injectable instance of `ExceptionAdapater` diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Desugarer.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Desugarer.scala index 8d51458c17..0182db022d 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Desugarer.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Desugarer.scala @@ -7,7 +7,7 @@ import at.forsyte.apalache.tla.lir.oper._ import at.forsyte.apalache.tla.lir.transformations.{TlaExTransformation, TransformationTracker} import at.forsyte.apalache.tla.lir.values.{TlaInt, TlaStr} -import javax.inject.Singleton +import com.google.inject.Singleton import at.forsyte.apalache.tla.typecomp.ScopedBuilder /** diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/ExprOptimizer.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/ExprOptimizer.scala index e4759776e4..e85d215f85 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/ExprOptimizer.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/ExprOptimizer.scala @@ -8,8 +8,7 @@ import at.forsyte.apalache.tla.lir.transformations.{LanguageWatchdog, TlaExTrans import at.forsyte.apalache.tla.lir.values.{TlaInt, TlaStr} import TypedPredefs._ -import javax.inject.Singleton -import scala.math.BigInt +import com.google.inject.Singleton /** *

An optimizer of KerA+ expressions.

diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Keramelizer.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Keramelizer.scala index 9d0ee4e6c3..6798860e5a 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Keramelizer.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Keramelizer.scala @@ -7,7 +7,7 @@ import at.forsyte.apalache.tla.lir.oper._ import at.forsyte.apalache.tla.lir.transformations.standard.FlatLanguagePred import at.forsyte.apalache.tla.lir.transformations.{LanguageWatchdog, TlaExTransformation, TransformationTracker} -import javax.inject.Singleton +import com.google.inject.Singleton /** *

A simplifier from TLA+ to KerA+. This transformation assumes that all operator definitions and internal diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Normalizer.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Normalizer.scala index dfaa91f786..0bacea59a0 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Normalizer.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/Normalizer.scala @@ -8,7 +8,7 @@ import at.forsyte.apalache.tla.lir.transformations.{LanguageWatchdog, TlaExTrans import at.forsyte.apalache.tla.lir.values.TlaBool import at.forsyte.apalache.tla.lir._ -import javax.inject.Singleton +import com.google.inject.Singleton /** * This transformation turns subexpressions of a TLA+ expression into negated normal form. diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/TypeSubstitutor.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/TypeSubstitutor.scala index 339db73778..3794625c14 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/TypeSubstitutor.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/TypeSubstitutor.scala @@ -5,7 +5,7 @@ import at.forsyte.apalache.tla.lir._ import at.forsyte.apalache.tla.lir.transformations.{TlaExTransformation, TransformationTracker} import at.forsyte.apalache.tla.types.Substitution -import javax.inject.Singleton +import com.google.inject.Singleton /** *

Apply a type substitution to the types of a subexpression.

diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/LoopEncoder.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/LoopEncoder.scala index 89cb1a0631..251df715b3 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/LoopEncoder.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/LoopEncoder.scala @@ -2,7 +2,7 @@ package at.forsyte.apalache.tla.pp.temporal import at.forsyte.apalache.tla.lir._ -import javax.inject.Singleton +import com.google.inject.Singleton import com.typesafe.scalalogging.LazyLogging import at.forsyte.apalache.tla.typecomp._ import at.forsyte.apalache.tla.pp.temporal.DeclUtils._ diff --git a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/TableauEncoder.scala b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/TableauEncoder.scala index 6a286f0e4b..bbe34948f2 100644 --- a/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/TableauEncoder.scala +++ b/tla-pp/src/main/scala/at/forsyte/apalache/tla/pp/temporal/TableauEncoder.scala @@ -2,7 +2,7 @@ package at.forsyte.apalache.tla.pp.temporal import at.forsyte.apalache.tla.lir._ -import javax.inject.Singleton +import com.google.inject.Singleton import com.typesafe.scalalogging.LazyLogging import scalaz.Scalaz.{init => _} import at.forsyte.apalache.tla.pp.UniqueNameGenerator diff --git a/tlair/src/main/scala/at/forsyte/apalache/tla/lir/transformations/standard/IncrementalRenaming.scala b/tlair/src/main/scala/at/forsyte/apalache/tla/lir/transformations/standard/IncrementalRenaming.scala index 60c739fac9..5f4a3036bf 100644 --- a/tlair/src/main/scala/at/forsyte/apalache/tla/lir/transformations/standard/IncrementalRenaming.scala +++ b/tlair/src/main/scala/at/forsyte/apalache/tla/lir/transformations/standard/IncrementalRenaming.scala @@ -6,7 +6,7 @@ import at.forsyte.apalache.tla.lir.transformations.{ TlaDeclTransformation, TlaExTransformation, TlaModuleTransformation, TransformationTracker, } -import javax.inject.{Inject, Singleton} +import com.google.inject.{Inject, Singleton} import scala.collection.immutable.HashMap // Igor @ 07.11.2019: refactoring needed