From 16811f3014ac0ab20ebb0cace665bf8b01e15a91 Mon Sep 17 00:00:00 2001 From: Zoltan Ujhelyi Date: Sat, 23 Sep 2023 16:47:46 +0200 Subject: [PATCH] [582461] Makes codebase compatible with Guice 7.0 Guice 7.0 stopped supporting the injector-framework independent `javax.inject`, `javax.servlet` and `javax.persistence` packages in favor of `jakarta.inject`, `jakarta.servlet` and `jakarta.persistence`, breaking injections relying on these components when using the new version. See https://github.com/google/guice/wiki/Guice700 for details. This commit replaces these usages with the Guice-specific annotations as they are compatible with Guice 3.0-7.0 releases that is necessary to support all the environments VIATRA 2.8 aims to support. Change-Id: I2164a492f330d2e56c74171fc034c357fc360942 Signed-off-by: Zoltan Ujhelyi --- .../META-INF/MANIFEST.MF | 4 ++-- .../runtime/validation/QueryBasedFeaturePatternValidator.java | 2 +- .../runtime/validation/SurrogatePatternValidator.java | 2 +- .../EMFPatternLanguageGeneratorEclipseConfigProvider.java | 3 +-- .../tooling/ui/migrator/metadata/ProjectNatureUpdater.java | 2 +- .../emf/util/EMFPatternLanguageGeneratorConfigProvider.java | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/META-INF/MANIFEST.MF b/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/META-INF/MANIFEST.MF index 6e31ef4cd8..b5569a4e19 100644 --- a/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/META-INF/MANIFEST.MF +++ b/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/META-INF/MANIFEST.MF @@ -7,6 +7,6 @@ Bundle-Vendor: Eclipse VIATRA Project Fragment-Host: org.eclipse.viatra.addon.querybasedfeatures.runtime;bundle-version="[2.8.0,2.9.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.viatra.addon.querybasedfeatures.runtime.validation -Require-Bundle: org.eclipse.viatra.query.patternlanguage.emf;bundle-version="[2.8.0,2.9.0)" -Import-Package: javax.inject +Require-Bundle: org.eclipse.viatra.query.patternlanguage.emf;bundle-version="[2.8.0,2.9.0)", + com.google.inject Automatic-Module-Name: org.eclipse.viatra.addon.querybasedfeatures.runtime.validation diff --git a/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/QueryBasedFeaturePatternValidator.java b/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/QueryBasedFeaturePatternValidator.java index 79b180bb54..5b1871eed4 100644 --- a/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/QueryBasedFeaturePatternValidator.java +++ b/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/QueryBasedFeaturePatternValidator.java @@ -11,7 +11,7 @@ import java.util.Collection; import java.util.Optional; -import javax.inject.Inject; +import com.google.inject.Inject; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; diff --git a/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/SurrogatePatternValidator.java b/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/SurrogatePatternValidator.java index aef09e6efb..1f49bf6e77 100644 --- a/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/SurrogatePatternValidator.java +++ b/addon/plugins/org.eclipse.viatra.addon.querybasedfeatures.runtime.validation/src/org/eclipse/viatra/addon/querybasedfeatures/runtime/validation/SurrogatePatternValidator.java @@ -11,7 +11,7 @@ import java.util.Collection; import java.util.Optional; -import javax.inject.Inject; +import com.google.inject.Inject; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; diff --git a/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/patternlanguage/emf/ui/builder/configuration/EMFPatternLanguageGeneratorEclipseConfigProvider.java b/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/patternlanguage/emf/ui/builder/configuration/EMFPatternLanguageGeneratorEclipseConfigProvider.java index a6a6c2c660..38ca475806 100644 --- a/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/patternlanguage/emf/ui/builder/configuration/EMFPatternLanguageGeneratorEclipseConfigProvider.java +++ b/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/patternlanguage/emf/ui/builder/configuration/EMFPatternLanguageGeneratorEclipseConfigProvider.java @@ -8,8 +8,6 @@ *******************************************************************************/ package org.eclipse.viatra.query.patternlanguage.emf.ui.builder.configuration; -import javax.inject.Inject; - import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IStorage; import org.eclipse.emf.ecore.EObject; @@ -19,6 +17,7 @@ import org.eclipse.xtext.xbase.compiler.IGeneratorConfigProvider; import com.google.common.collect.Iterables; +import com.google.inject.Inject; /** * This class is a modified version of {@link org.eclipse.xtext.xbase.ui.builder.EclipseGeneratorConfigProvider} that diff --git a/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/tooling/ui/migrator/metadata/ProjectNatureUpdater.java b/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/tooling/ui/migrator/metadata/ProjectNatureUpdater.java index 21a5ee03a7..ca87905904 100644 --- a/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/tooling/ui/migrator/metadata/ProjectNatureUpdater.java +++ b/query/plugins/org.eclipse.viatra.query.patternlanguage.emf.ui/src/org/eclipse/viatra/query/tooling/ui/migrator/metadata/ProjectNatureUpdater.java @@ -8,7 +8,7 @@ *******************************************************************************/ package org.eclipse.viatra.query.tooling.ui.migrator.metadata; -import javax.inject.Inject; +import com.google.inject.Inject; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; diff --git a/query/plugins/org.eclipse.viatra.query.patternlanguage.emf/src/org/eclipse/viatra/query/patternlanguage/emf/util/EMFPatternLanguageGeneratorConfigProvider.java b/query/plugins/org.eclipse.viatra.query.patternlanguage.emf/src/org/eclipse/viatra/query/patternlanguage/emf/util/EMFPatternLanguageGeneratorConfigProvider.java index 2817e651aa..630781d14c 100644 --- a/query/plugins/org.eclipse.viatra.query.patternlanguage.emf/src/org/eclipse/viatra/query/patternlanguage/emf/util/EMFPatternLanguageGeneratorConfigProvider.java +++ b/query/plugins/org.eclipse.viatra.query.patternlanguage.emf/src/org/eclipse/viatra/query/patternlanguage/emf/util/EMFPatternLanguageGeneratorConfigProvider.java @@ -13,7 +13,7 @@ import java.io.IOException; import java.util.Properties; -import javax.inject.Inject; +import com.google.inject.Inject; import org.apache.log4j.Logger; import org.eclipse.emf.common.util.URI;