aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2018-11-29 18:40:25 +0100
committersonartech <sonartech@sonarsource.com>2019-01-16 09:43:04 +0100
commit10e2a7a4152933a0c8a533d78255f737ed69c6da (patch)
tree0e4cf72e8ef5e8421a5c051cf03b40a40357419a
parent39018d34ad793430e64f59f71c813d266357ce3b (diff)
downloadsonarqube-10e2a7a4152933a0c8a533d78255f737ed69c6da.tar.gz
sonarqube-10e2a7a4152933a0c8a533d78255f737ed69c6da.zip
SONAR-11465 API cleanup
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/config/Logback.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracker.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/Startable.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectBuilder.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/FileSystem.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/measure/MetricFinder.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/ActiveRules.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rules.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/ce/ComputeEngineSide.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/Configuration.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/FileLinesContextFactory.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/EnvironmentInformation.java3
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContext.java10
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContextFactory.java10
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ExtensionMatcher.java6
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/MetricProvider.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginInstaller.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginJarExploder.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginPredicate.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/deprecated/perspectives/PerspectiveBuilder.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstaller.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueCache.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/AbstractPatternInitializer.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/IssueTransition.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerIssueRepository.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerLineHashesLoader.java3
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/postjob/PostJobOptimizer.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/report/AnalysisContextReportPublisher.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java5
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/language/LanguagesRepository.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ModuleScanContainer.java11
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectScanContainer.java7
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ScanProperties.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchConfigurationLoader.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchParamsValidator.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranchesLoader.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectPullRequestsLoader.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/measure/MeasureCache.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/Storages.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/StoragesManager.java2
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstallerTest.java2
79 files changed, 72 insertions, 176 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java b/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java
index c4a46a19ddc..739234fb242 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java
@@ -19,7 +19,7 @@
*/
package org.sonar.core.component;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.ResourceType;
diff --git a/sonar-core/src/main/java/org/sonar/core/config/Logback.java b/sonar-core/src/main/java/org/sonar/core/config/Logback.java
index bd738d0e467..22fef28406f 100644
--- a/sonar-core/src/main/java/org/sonar/core/config/Logback.java
+++ b/sonar-core/src/main/java/org/sonar/core/config/Logback.java
@@ -31,14 +31,12 @@ import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.LoggerFactory;
-import org.sonar.api.batch.ScannerSide;
/**
* Configure Logback
*
* @since 2.12
*/
-@ScannerSide
public class Logback {
private Logback() {
diff --git a/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java b/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java
index e641e557007..5fa2df5d720 100644
--- a/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java
+++ b/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java
@@ -41,7 +41,6 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.io.IOUtils;
import org.picocontainer.Startable;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.i18n.I18n;
import org.sonar.api.utils.SonarException;
import org.sonar.api.utils.System2;
@@ -52,7 +51,6 @@ import org.sonar.core.platform.PluginRepository;
import static java.nio.charset.StandardCharsets.UTF_8;
-@ScannerSide
public class DefaultI18n implements I18n, Startable {
private static final Logger LOG = Loggers.get(DefaultI18n.class);
diff --git a/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java b/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java
index f4c1fff2794..61ec07b12d1 100644
--- a/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java
+++ b/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java
@@ -22,17 +22,15 @@ package org.sonar.core.i18n;
import java.util.Locale;
import javax.annotation.CheckForNull;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.i18n.RuleI18n;
import org.sonar.api.rules.Rule;
-import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
* @deprecated in 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/browse/SONAR-4885
*/
@Deprecated
-@ScannerSide
@ServerSide
@ComputeEngineSide
public class RuleI18nManager implements RuleI18n {
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracker.java b/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracker.java
index 7ace40bd967..9b4e6f504d9 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracker.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracker.java
@@ -22,13 +22,11 @@ package org.sonar.core.issue.tracking;
import java.util.Collection;
import java.util.List;
import java.util.stream.Stream;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.issue.Issue;
import static org.sonar.core.util.stream.MoreCollectors.toList;
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ScannerSide
public class Tracker<RAW extends Trackable, BASE extends Trackable> extends AbstractTracker<RAW, BASE> {
diff --git a/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java b/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java
index c9c2f3010af..ee6830f2100 100644
--- a/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java
+++ b/sonar-core/src/main/java/org/sonar/core/metric/ScannerMetrics.java
@@ -26,7 +26,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Stream;
import javax.annotation.concurrent.Immutable;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.measures.Metric;
import org.sonar.api.measures.Metrics;
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
index fe0f63d6d5d..6e57afd8ead 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
@@ -36,7 +36,7 @@ import org.picocontainer.MutablePicoContainer;
import org.picocontainer.PicoContainer;
import org.picocontainer.behaviors.OptInCaching;
import org.picocontainer.monitors.NullComponentMonitor;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.config.PropertyDefinitions;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
index 96ae00dcb56..3387b65c4fc 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
@@ -25,7 +25,7 @@ import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.classloader.ClassloaderBuilder;
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java
index d8364bf55b8..7bcbb7906ae 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java
@@ -21,7 +21,7 @@ package org.sonar.core.platform;
import java.util.Collection;
import org.sonar.api.Plugin;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java b/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java
index 6a8bbab1479..8c73b6e4396 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java
@@ -122,10 +122,10 @@ public interface Plugin {
/**
* Add an extension as :
* <ul>
- * <li>a Class that is annotated with {@link org.sonar.api.batch.ScannerSide}, {@link org.sonar.api.server.ServerSide}
+ * <li>a Class that is annotated with {@link org.sonar.api.scanner.ScannerSide}, {@link org.sonar.api.server.ServerSide}
* or {@link org.sonar.api.ce.ComputeEngineSide}. The extension will be instantiated once. Its dependencies are
* injected through constructor parameters.</li>
- * <li>an instance that is annotated with {@link org.sonar.api.batch.ScannerSide}, {@link org.sonar.api.server.ServerSide}
+ * <li>an instance that is annotated with {@link org.sonar.api.scanner.ScannerSide}, {@link org.sonar.api.server.ServerSide}
* or {@link org.sonar.api.ce.ComputeEngineSide}.</li>
* </ul>
* Only a single component can be registered for a class. It's not allowed for example to register:
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java b/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java
index b5750ed18c6..191fe27b5df 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java
@@ -20,7 +20,7 @@
package org.sonar.api;
import javax.annotation.concurrent.Immutable;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.ce.ComputeEngineSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java b/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java
index e741df75e20..0eecfb6977e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/SonarRuntime.java
@@ -21,7 +21,7 @@ package org.sonar.api;
import javax.annotation.concurrent.Immutable;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.ce.ComputeEngineSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/Startable.java b/sonar-plugin-api/src/main/java/org/sonar/api/Startable.java
index 798217bdfae..34718964aa1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/Startable.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/Startable.java
@@ -20,7 +20,7 @@
package org.sonar.api;
/**
- * An interface which is implemented by classes annotated with {@link org.sonar.api.batch.ScannerSide ScannerSide},
+ * An interface which is implemented by classes annotated with {@link org.sonar.api.scanner.ScannerSide ScannerSide},
* {@link org.sonar.api.server.ServerSide ServerSide} and/or {@link org.sonar.api.ce.ComputeEngineSide ComputeEngineSide}
* (referred to below as "component") that can be started and stopped.
* <p>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectBuilder.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectBuilder.java
index 67a1ec6f77b..ae2db71c34c 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectBuilder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectBuilder.java
@@ -20,8 +20,7 @@
package org.sonar.api.batch.bootstrap;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
/**
* This extension point allows to change project structure at runtime. It is executed once during task startup.
@@ -37,7 +36,6 @@ import org.sonar.api.batch.ScannerSide;
* @since 2.9
*/
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ExtensionPoint
@Deprecated
public abstract class ProjectBuilder {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java
index 4f7393cb073..1883e060151 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.batch.bootstrap;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import java.util.ArrayList;
import java.util.List;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/FileSystem.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/FileSystem.java
index 433c87c57bb..f83ac3c2b87 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/FileSystem.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/FileSystem.java
@@ -23,7 +23,7 @@ import java.io.File;
import java.nio.charset.Charset;
import java.util.SortedSet;
import javax.annotation.CheckForNull;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
/**
* The {@link FileSystem} manages all the source files to be analyzed.
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/measure/MetricFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/measure/MetricFinder.java
index b8955cda127..ca416e46727 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/measure/MetricFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/measure/MetricFinder.java
@@ -25,7 +25,7 @@ import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.concurrent.ThreadSafe;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
/**
* @since 4.5
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/ActiveRules.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/ActiveRules.java
index 9d61ff97bbd..38f45787458 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/ActiveRules.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/ActiveRules.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.batch.rule;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.rule.RuleKey;
import javax.annotation.CheckForNull;
@@ -28,7 +28,7 @@ import javax.annotation.concurrent.Immutable;
import java.util.Collection;
/**
- * The rules that are activated on the current module. Quality profiles are
+ * The rules that are activated on the current project. Quality profiles are
* merged, so rules can relate to different repositories and languages.
* <br>
* Use {@link org.sonar.api.batch.rule.internal.ActiveRulesBuilder} to instantiate
@@ -43,7 +43,7 @@ public interface ActiveRules {
/**
* Find a {@link ActiveRule} by the associated rule key. <code>null</code>
* is returned if the rule does not exist or if the rule is not activated
- * on any Quality profile associated with the module.
+ * on any Quality profile associated with the project.
*/
@CheckForNull
ActiveRule find(RuleKey ruleKey);
@@ -66,7 +66,7 @@ public interface ActiveRules {
/**
* Find a {@link ActiveRule} by the associated internal key. <code>null</code>
* is returned if the rule does not exist or if the rule is not activated
- * on any Quality profile associated with the module.
+ * on any Quality profile associated with the project.
*/
@CheckForNull
ActiveRule findByInternalKey(String repository, String internalKey);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rules.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rules.java
index 8537942b462..54c53c1b12a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rules.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rules.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.batch.rule;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.rule.RuleKey;
import javax.annotation.CheckForNull;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java
index 1c227c9d796..1ee042001d5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java
@@ -26,14 +26,12 @@ import java.util.Set;
import javax.annotation.CheckForNull;
import org.sonar.api.CoreProperties;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
/**
* @since 5.0
*/
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ExtensionPoint
public abstract class ScmProvider {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java
index 3dae10cc39e..f3d1210a2d3 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.batch.sensor.internal;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.sensor.code.internal.DefaultSignificantCode;
import org.sonar.api.batch.sensor.coverage.internal.DefaultCoverage;
import org.sonar.api.batch.sensor.cpd.internal.DefaultCpdTokens;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ce/ComputeEngineSide.java b/sonar-plugin-api/src/main/java/org/sonar/api/ce/ComputeEngineSide.java
index a0d6f430733..98088c843e6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/ce/ComputeEngineSide.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/ce/ComputeEngineSide.java
@@ -24,7 +24,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
/**
* Same as {@link ScannerSide} but for components for the Compute Engine Server.
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Configuration.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/Configuration.java
index d10856b51cf..2a1ee512bc0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Configuration.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/Configuration.java
@@ -20,7 +20,7 @@
package org.sonar.api.config;
import java.util.Optional;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.server.ServerSide;
@@ -29,7 +29,7 @@ import org.sonarsource.api.sonarlint.SonarLintSide;
/**
* Component to get effective configuration. Values of properties depend on the runtime environment:
* <ul>
- * <li>immutable project or module configuration in scanner.</li>
+ * <li>immutable project configuration in scanner.</li>
* <li>global configuration in web server. It does not allow to get the settings overridden on projects.</li>
* <li>project configuration in Compute Engine.</li>
* </ul>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java
index 0c1f582c588..611c28431ab 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java
@@ -34,7 +34,7 @@ import org.apache.commons.lang.math.NumberUtils;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.Property;
import org.sonar.api.PropertyType;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
index d835e6e8789..e805460f5cf 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
@@ -30,7 +30,7 @@ import org.apache.commons.lang.StringUtils;
import org.sonar.api.CoreProperties;
import org.sonar.api.Properties;
import org.sonar.api.Property;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.AnnotationUtils;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
index f6ee51f3108..10f6cc90af6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
@@ -31,7 +31,7 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.DateUtils;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
index 616e6d73b55..859c69e8a32 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
@@ -22,7 +22,6 @@ package org.sonar.api.i18n;
import java.util.Date;
import java.util.Locale;
import javax.annotation.Nullable;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
@@ -31,7 +30,6 @@ import org.sonar.api.server.ServerSide;
*
* @since 2.10
*/
-@ScannerSide
@ServerSide
@ComputeEngineSide
public interface I18n {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
index 8ace5945ab1..c3a9d565659 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
@@ -21,9 +21,8 @@ package org.sonar.api.i18n;
import java.util.Locale;
import javax.annotation.CheckForNull;
-import org.sonar.api.batch.ScannerSide;
-import org.sonar.api.rules.Rule;
import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.rules.Rule;
import org.sonar.api.server.ServerSide;
/**
@@ -33,7 +32,6 @@ import org.sonar.api.server.ServerSide;
* @deprecated in 4.1. Rules are not localized anymore. See http://jira.sonarsource.com/browse/SONAR-4885
*/
@Deprecated
-@ScannerSide
@ServerSide
@ComputeEngineSide
public interface RuleI18n {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java
index daa61abac6b..681c0c56f96 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java
@@ -25,7 +25,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.CheckForNull;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.Duration;
@@ -172,9 +171,6 @@ public interface Issue extends Serializable {
/**
* Non-null list of comments, ordered by chronological order.
- * <br>
- * IMPORTANT: existing comments are not loaded when this method is called when analyzing project
- * (from {@link ScannerSide}).
*
* @deprecated since 7.2, comments are not more available
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java
index 4e2dd334ae0..4d97e5a378e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/ProjectIssues.java
@@ -19,10 +19,7 @@
*/
package org.sonar.api.issue;
-import org.sonar.api.batch.ScannerSide;
-import org.sonar.api.batch.InstantiationStrategy;
-
-import static org.sonar.api.batch.InstantiationStrategy.PER_BATCH;
+import org.sonar.api.scanner.ScannerSide;
/**
* Used by batch components to get all project issues.
@@ -30,7 +27,6 @@ import static org.sonar.api.batch.InstantiationStrategy.PER_BATCH;
* @since 4.0
* @deprecated since 7.3 preview mode is deprecated since 6.6
*/
-@InstantiationStrategy(PER_BATCH)
@ScannerSide
@Deprecated
public interface ProjectIssues {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/FileLinesContextFactory.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/FileLinesContextFactory.java
index 3606b088ee5..99c71381c8e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/FileLinesContextFactory.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/FileLinesContextFactory.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.measures;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.fs.InputFile;
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
index a6dcd3d7e3b..f7e199ff592 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
@@ -27,9 +27,8 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.server.ServerSide;
import static com.google.common.base.MoreObjects.firstNonNull;
@@ -38,10 +37,8 @@ import static org.apache.commons.lang.StringUtils.isNotBlank;
/**
* Used to define a metric in a plugin. Should be used with {@link Metrics} extension point.
- * Should no more be used on scanner side. Use {@link org.sonar.api.batch.measure.Metric} instead.
*/
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ServerSide
@ComputeEngineSide
public class Metric<G extends Serializable> implements Serializable, org.sonar.api.batch.measure.Metric<G> {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
index c147fc23786..513df7c4f05 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
@@ -22,7 +22,7 @@ package org.sonar.api.measures;
import java.util.Collection;
import java.util.List;
import javax.annotation.CheckForNull;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java
index 9bdfb4cc560..8c79afd0f60 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java
@@ -21,9 +21,8 @@ package org.sonar.api.measures;
import java.util.List;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.server.ServerSide;
/**
@@ -31,7 +30,6 @@ import org.sonar.api.server.ServerSide;
* @since 1.10
*/
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ServerSide
@ComputeEngineSide
@ExtensionPoint
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
index 36d4b9f47a6..c9d37454cb4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
@@ -21,7 +21,7 @@ package org.sonar.api.platform;
import java.io.File;
import java.util.Date;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
index 0fbcabc17d3..a5b7cb24136 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
@@ -20,21 +20,17 @@
package org.sonar.api.resources;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.batch.ScannerSide;
-import org.sonar.api.batch.InstantiationStrategy;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonarsource.api.sonarlint.SonarLintSide;
/**
* The extension point to define a new language
- * <br>
- * Instantiation strategy changed to PER_BATCH in version 4.2.
*
* @since 1.10
*/
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ServerSide
@SonarLintSide
@ComputeEngineSide
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
index a5447371fb4..2bf0aab9a7d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
@@ -26,7 +26,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.ArrayUtils;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.log.Logger;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java
index ce815d5b7cf..c747bab32b3 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java
@@ -27,7 +27,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java
index 923aa96db82..2f55099ba5c 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/PathResolver.java
@@ -28,7 +28,7 @@ import java.util.Optional;
import javax.annotation.CheckForNull;
import javax.annotation.concurrent.Immutable;
import org.apache.commons.io.FilenameUtils;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.utils.PathUtils;
import static java.util.stream.Collectors.joining;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java
index 056855baeb7..604769decb0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java
@@ -24,7 +24,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
/**
* Same as {@link ScannerSide} but for server-side components.
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
index 91de65ec2c8..88c057937a4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
@@ -20,14 +20,12 @@
package org.sonar.api.utils;
import java.util.Locale;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
* @since 4.3
*/
-@ScannerSide
@ServerSide
@ComputeEngineSide
public class Durations {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
index 8ff9dedf4af..6c702e2a924 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.utils;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.server.ServerSide;
import java.io.File;
@@ -28,7 +28,7 @@ import java.net.URI;
/**
* This component is available in IoC container, so it should be injected through
- * a constructor parameter. It is available in both batch and server.
+ * a constructor parameter. It is available in both scanner and server.
*/
@ScannerSide
@ServerSide
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
index 5dc8bc9377b..2f2ee31eef1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
@@ -27,7 +27,7 @@ import java.util.Properties;
import java.util.TimeZone;
import javax.annotation.CheckForNull;
import org.apache.commons.lang.SystemUtils;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java
index 85d1c04a6fa..b77c68a78e0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java
@@ -21,7 +21,7 @@ package org.sonar.api.utils;
import java.io.File;
import javax.annotation.Nullable;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java
index a890082946b..920ec7543ac 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java
@@ -31,7 +31,7 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Stream;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/EnvironmentInformation.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/EnvironmentInformation.java
index d9b86aa2c23..917a2ad621a 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/EnvironmentInformation.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/bootstrapper/EnvironmentInformation.java
@@ -19,14 +19,11 @@
*/
package org.sonar.batch.bootstrapper;
-import org.sonar.api.batch.ScannerSide;
-
/**
* Describes execution environment.
*
* @since 2.6
*/
-@ScannerSide
public class EnvironmentInformation {
private String key;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContext.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContext.java
index ea3130d2ecd..7ef71bbb221 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContext.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContext.java
@@ -27,7 +27,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.measure.MetricFinder;
-import org.sonar.api.batch.sensor.SensorContext;
+import org.sonar.api.batch.sensor.internal.SensorStorage;
import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.FileLinesContext;
@@ -38,7 +38,6 @@ import org.sonar.scanner.scan.measure.MeasureCache;
import static java.util.stream.Collectors.toMap;
public class DefaultFileLinesContext implements FileLinesContext {
- private final SensorContext context;
private final InputFile inputFile;
private final MetricFinder metricFinder;
private final MeasureCache measureCache;
@@ -47,9 +46,10 @@ public class DefaultFileLinesContext implements FileLinesContext {
* metric key -> line -> value
*/
private final Map<String, Map<Integer, Object>> map = new HashMap<>();
+ private final SensorStorage sensorStorage;
- public DefaultFileLinesContext(SensorContext context, InputFile inputFile, MetricFinder metricFinder, MeasureCache measureCache) {
- this.context = context;
+ public DefaultFileLinesContext(SensorStorage sensorStorage, InputFile inputFile, MetricFinder metricFinder, MeasureCache measureCache) {
+ this.sensorStorage = sensorStorage;
this.inputFile = inputFile;
this.metricFinder = metricFinder;
this.measureCache = measureCache;
@@ -103,7 +103,7 @@ public class DefaultFileLinesContext implements FileLinesContext {
Map<Integer, Object> lines = entry.getValue();
if (shouldSave(lines)) {
String data = KeyValueFormat.format(optimizeStorage(metricKey, lines));
- context.newMeasure()
+ new DefaultMeasure<String>(sensorStorage)
.on(inputFile)
.forMetric(metricFinder.findByKey(metricKey))
.withValue(data)
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContextFactory.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContextFactory.java
index 01c6f9a16b2..8ed50b88710 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContextFactory.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/DefaultFileLinesContextFactory.java
@@ -22,7 +22,7 @@ package org.sonar.scanner;
import javax.annotation.concurrent.Immutable;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.measure.MetricFinder;
-import org.sonar.api.batch.sensor.SensorContext;
+import org.sonar.api.batch.sensor.internal.SensorStorage;
import org.sonar.api.measures.FileLinesContext;
import org.sonar.api.measures.FileLinesContextFactory;
import org.sonar.scanner.scan.measure.MeasureCache;
@@ -30,19 +30,19 @@ import org.sonar.scanner.scan.measure.MeasureCache;
@Immutable
public class DefaultFileLinesContextFactory implements FileLinesContextFactory {
- private final SensorContext sensorContext;
+ private final SensorStorage sensorStorage;
private final MetricFinder metricFinder;
private final MeasureCache measureCache;
- public DefaultFileLinesContextFactory(SensorContext sensorContext, MetricFinder metricFinder, MeasureCache measureCache) {
- this.sensorContext = sensorContext;
+ public DefaultFileLinesContextFactory(SensorStorage sensorStorage, MetricFinder metricFinder, MeasureCache measureCache) {
+ this.sensorStorage = sensorStorage;
this.metricFinder = metricFinder;
this.measureCache = measureCache;
}
@Override
public FileLinesContext createFor(InputFile inputFile) {
- return new DefaultFileLinesContext(sensorContext, inputFile, metricFinder, measureCache);
+ return new DefaultFileLinesContext(sensorStorage, inputFile, metricFinder, measureCache);
}
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ExtensionMatcher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ExtensionMatcher.java
index 81eb100aeac..7fb6b2b0960 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ExtensionMatcher.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ExtensionMatcher.java
@@ -19,12 +19,6 @@
*/
package org.sonar.scanner.bootstrap;
-import org.sonar.api.batch.ScannerSide;
-
-/**
- * @since 3.6
- */
-@ScannerSide
public interface ExtensionMatcher {
boolean accept(Object extension);
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/MetricProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/MetricProvider.java
index 34c874b6684..5d3fb8158db 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/MetricProvider.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/MetricProvider.java
@@ -22,14 +22,12 @@ package org.sonar.scanner.bootstrap;
import com.google.common.collect.Lists;
import java.util.List;
import org.sonar.api.ExtensionProvider;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
import org.sonar.api.measures.Metrics;
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public class MetricProvider extends ExtensionProvider {
private Metrics[] factories;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginInstaller.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginInstaller.java
index cf3b1ac02b7..97e7ed86939 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginInstaller.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/PluginInstaller.java
@@ -21,9 +21,7 @@ package org.sonar.scanner.bootstrap;
import java.util.List;
import java.util.Map;
-import org.sonar.api.batch.ScannerSide;
-@ScannerSide
public interface PluginInstaller {
/**
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginJarExploder.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginJarExploder.java
index d3180b89f35..5baf3fe4766 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginJarExploder.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginJarExploder.java
@@ -23,7 +23,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.utils.ZipUtils;
import org.sonar.core.platform.ExplodedPlugin;
import org.sonar.core.platform.PluginInfo;
@@ -31,7 +30,6 @@ import org.sonar.core.platform.PluginJarExploder;
import static org.sonar.core.util.FileUtils.deleteQuietly;
-@ScannerSide
public class ScannerPluginJarExploder extends PluginJarExploder {
private final PluginFiles pluginFiles;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginPredicate.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginPredicate.java
index 678640cc45b..70b918071c1 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginPredicate.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerPluginPredicate.java
@@ -29,7 +29,6 @@ import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import javax.annotation.Nonnull;
import org.sonar.api.CoreProperties;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
@@ -37,7 +36,6 @@ import org.sonar.api.utils.log.Loggers;
/**
* Filters the plugins to be enabled during analysis
*/
-@ScannerSide
public class ScannerPluginPredicate implements Predicate<String> {
private static final Logger LOG = Loggers.get(ScannerPluginPredicate.class);
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
index 23370fdc0f3..810a2c37a41 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerWsClientProvider.java
@@ -21,7 +21,6 @@ package org.sonar.scanner.bootstrap;
import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.api.CoreProperties;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.utils.System2;
import org.sonar.batch.bootstrapper.EnvironmentInformation;
import org.sonarqube.ws.client.HttpConnector;
@@ -31,7 +30,6 @@ import static java.lang.Integer.parseInt;
import static java.lang.String.valueOf;
import static org.apache.commons.lang.StringUtils.defaultIfBlank;
-@ScannerSide
public class ScannerWsClientProvider extends ProviderAdapter {
static final int CONNECT_TIMEOUT_MS = 5_000;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/deprecated/perspectives/PerspectiveBuilder.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/deprecated/perspectives/PerspectiveBuilder.java
index 73e089604a3..b11a852803c 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/deprecated/perspectives/PerspectiveBuilder.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/deprecated/perspectives/PerspectiveBuilder.java
@@ -20,11 +20,9 @@
package org.sonar.scanner.deprecated.perspectives;
import javax.annotation.CheckForNull;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.component.Perspective;
-@ScannerSide
public abstract class PerspectiveBuilder<T extends Perspective> {
private final Class<T> perspectiveClass;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstaller.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstaller.java
index f4825292dfd..419857e2783 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstaller.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstaller.java
@@ -20,7 +20,7 @@
package org.sonar.scanner.extension;
import org.sonar.api.SonarRuntime;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.core.extension.CoreExtensionRepository;
import org.sonar.core.extension.CoreExtensionsInstaller;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueCache.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueCache.java
index fc2196ef53d..8ff0a0f5526 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueCache.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/IssueCache.java
@@ -20,7 +20,6 @@
package org.sonar.scanner.issue;
import java.util.Collection;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.scanner.issue.tracking.TrackedIssue;
import org.sonar.scanner.storage.Storage;
import org.sonar.scanner.storage.Storages;
@@ -28,7 +27,6 @@ import org.sonar.scanner.storage.Storages;
/**
* Shared issues among all project modules
*/
-@ScannerSide
public class IssueCache {
// component key -> issue key -> issue
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/AbstractPatternInitializer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/AbstractPatternInitializer.java
index 8d26bed1a9a..51058404811 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/AbstractPatternInitializer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/ignore/pattern/AbstractPatternInitializer.java
@@ -24,12 +24,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.config.Configuration;
import static com.google.common.base.MoreObjects.firstNonNull;
-@ScannerSide
public abstract class AbstractPatternInitializer {
private Configuration settings;
private List<IssuePattern> multicriteriaPatterns;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/IssueTransition.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/IssueTransition.java
index dabba413c6c..737a4f6614a 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/IssueTransition.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/IssueTransition.java
@@ -25,7 +25,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.internal.DefaultInputComponent;
import org.sonar.core.util.CloseableIterator;
@@ -38,7 +37,6 @@ import org.sonar.scanner.report.ReportPublisher;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import org.sonar.scanner.util.ProgressReport;
-@ScannerSide
public class IssueTransition {
private final IssueCache issueCache;
private final InputComponentStore inputComponentStore;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerIssueRepository.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerIssueRepository.java
index be8c7908ff2..96acb3c1d94 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerIssueRepository.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerIssueRepository.java
@@ -19,8 +19,6 @@
*/
package org.sonar.scanner.issue.tracking;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.internal.AbstractProjectOrModule;
import org.sonar.api.batch.fs.internal.DefaultInputComponent;
@@ -34,8 +32,6 @@ import org.sonar.scanner.scan.filesystem.InputComponentStore;
import org.sonar.scanner.storage.Storage;
import org.sonar.scanner.storage.Storages;
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
-@ScannerSide
public class ServerIssueRepository {
private static final Logger LOG = Loggers.get(ServerIssueRepository.class);
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerLineHashesLoader.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerLineHashesLoader.java
index 291b28ba8e9..717e27b0c1e 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerLineHashesLoader.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/ServerLineHashesLoader.java
@@ -19,9 +19,6 @@
*/
package org.sonar.scanner.issue.tracking;
-import org.sonar.api.batch.ScannerSide;
-
-@ScannerSide
public interface ServerLineHashesLoader {
String[] getLineHashes(String fileKey);
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java
index 59ce0f1422f..69c396540bc 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/mediumtest/AnalysisObserver.java
@@ -20,7 +20,7 @@
package org.sonar.scanner.mediumtest;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.scanner.scan.ProjectScanContainer;
@ScannerSide
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java
index 8b53ab5e86d..dfe4993d31b 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java
@@ -24,7 +24,6 @@ import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.CoreProperties;
import org.sonar.api.SonarRuntime;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.config.Configuration;
import org.sonar.api.platform.Server;
import org.sonar.api.utils.DateUtils;
@@ -32,7 +31,6 @@ import org.sonar.scanner.bootstrap.ScannerWsClient;
import static org.apache.commons.lang.StringUtils.trimToEmpty;
-@ScannerSide
public class DefaultServer extends Server {
private final Configuration settings;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/postjob/PostJobOptimizer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/postjob/PostJobOptimizer.java
index 9bcf56bb6ca..dda587711a3 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/postjob/PostJobOptimizer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/postjob/PostJobOptimizer.java
@@ -21,11 +21,9 @@ package org.sonar.scanner.postjob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor;
import org.sonar.api.config.Configuration;
-@ScannerSide
public class PostJobOptimizer {
private static final Logger LOG = LoggerFactory.getLogger(PostJobOptimizer.class);
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/AnalysisContextReportPublisher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/AnalysisContextReportPublisher.java
index c0d091e824b..5c60eb4e2d2 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/AnalysisContextReportPublisher.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/AnalysisContextReportPublisher.java
@@ -32,7 +32,6 @@ import java.util.TreeSet;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.AnalysisMode;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.fs.internal.AbstractProjectOrModule;
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.InputModuleHierarchy;
@@ -48,7 +47,6 @@ import org.sonar.scanner.scan.filesystem.InputComponentStore;
import static java.util.stream.Collectors.toList;
-@ScannerSide
public class AnalysisContextReportPublisher {
private static final String KEY_VALUE_FORMAT = " - %s=%s";
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java
index ed2453601d1..2483a1dadc0 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ReportPublisher.java
@@ -36,7 +36,6 @@ import javax.annotation.Nullable;
import okhttp3.HttpUrl;
import org.apache.commons.io.FileUtils;
import org.picocontainer.Startable;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.fs.internal.InputModuleHierarchy;
import org.sonar.api.platform.Server;
import org.sonar.api.utils.MessageException;
@@ -63,7 +62,6 @@ import static org.sonar.scanner.scan.branch.BranchType.LONG;
import static org.sonar.scanner.scan.branch.BranchType.PULL_REQUEST;
import static org.sonar.scanner.scan.branch.BranchType.SHORT;
-@ScannerSide
public class ReportPublisher implements Startable {
private static final Logger LOG = Loggers.get(ReportPublisher.class);
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java
index 60aaaa6d46c..9d363ce09a1 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/ContextPropertiesCache.java
@@ -19,14 +19,11 @@
*/
package org.sonar.scanner.repository;
-import static com.google.common.base.Preconditions.checkArgument;
-
import java.util.HashMap;
import java.util.Map;
-import org.sonar.api.batch.ScannerSide;
+import static com.google.common.base.Preconditions.checkArgument;
-@ScannerSide
public class ContextPropertiesCache {
private final Map<String, String> props = new HashMap<>();
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/language/LanguagesRepository.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/language/LanguagesRepository.java
index f5492eb47f6..23a71432d9e 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/language/LanguagesRepository.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/language/LanguagesRepository.java
@@ -20,17 +20,13 @@
package org.sonar.scanner.repository.language;
import java.util.Collection;
-
import javax.annotation.CheckForNull;
import javax.annotation.concurrent.Immutable;
-import org.sonar.api.batch.ScannerSide;
-
/**
* Languages repository
* @since 4.4
*/
-@ScannerSide
@Immutable
public interface LanguagesRepository {
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ModuleScanContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ModuleScanContainer.java
index 2199bd3de38..58ef061c2c0 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ModuleScanContainer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ModuleScanContainer.java
@@ -23,9 +23,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.scan.filesystem.FileExclusions;
-import org.sonar.core.extension.CoreExtensionsInstaller;
import org.sonar.core.platform.ComponentContainer;
-import org.sonar.scanner.DefaultFileLinesContextFactory;
import org.sonar.scanner.bootstrap.ExtensionInstaller;
import org.sonar.scanner.bootstrap.SensorExtensionDictionnary;
import org.sonar.scanner.deprecated.perspectives.ScannerPerspectives;
@@ -33,11 +31,9 @@ import org.sonar.scanner.phases.SensorsExecutor;
import org.sonar.scanner.scan.filesystem.DefaultModuleFileSystem;
import org.sonar.scanner.scan.filesystem.ModuleInputComponentStore;
import org.sonar.scanner.sensor.DefaultSensorContext;
-import org.sonar.scanner.sensor.DefaultSensorStorage;
import org.sonar.scanner.sensor.SensorOptimizer;
import static org.sonar.api.batch.InstantiationStrategy.PER_PROJECT;
-import static org.sonar.core.extension.CoreExtensionsInstaller.noExtensionFilter;
import static org.sonar.scanner.bootstrap.ExtensionUtils.isDeprecatedScannerSide;
import static org.sonar.scanner.bootstrap.ExtensionUtils.isInstantiationStrategy;
@@ -73,19 +69,14 @@ public class ModuleScanContainer extends ComponentContainer {
SensorOptimizer.class,
- DefaultSensorStorage.class,
DefaultSensorContext.class,
SensorExtensionDictionnary.class,
// Perspectives
- ScannerPerspectives.class,
-
- DefaultFileLinesContextFactory.class);
+ ScannerPerspectives.class);
}
private void addExtensions() {
- CoreExtensionsInstaller coreExtensionsInstaller = getComponentByType(CoreExtensionsInstaller.class);
- coreExtensionsInstaller.install(this, noExtensionFilter(), t -> isInstantiationStrategy(t, PER_PROJECT));
ExtensionInstaller pluginInstaller = getComponentByType(ExtensionInstaller.class);
pluginInstaller.install(this, e -> isDeprecatedScannerSide(e) && isInstantiationStrategy(e, PER_PROJECT));
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectScanContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectScanContainer.java
index 34024ba5c50..578f8d120de 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectScanContainer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectScanContainer.java
@@ -36,6 +36,7 @@ import org.sonar.core.config.ScannerProperties;
import org.sonar.core.extension.CoreExtensionsInstaller;
import org.sonar.core.metric.ScannerMetrics;
import org.sonar.core.platform.ComponentContainer;
+import org.sonar.scanner.DefaultFileLinesContextFactory;
import org.sonar.scanner.ProjectAnalysisInfo;
import org.sonar.scanner.analysis.AnalysisTempFolderProvider;
import org.sonar.scanner.analysis.DefaultAnalysisMode;
@@ -121,6 +122,7 @@ import org.sonar.scanner.scan.report.JSONReport;
import org.sonar.scanner.scm.ScmChangedFilesProvider;
import org.sonar.scanner.scm.ScmConfiguration;
import org.sonar.scanner.scm.ScmPublisher;
+import org.sonar.scanner.sensor.DefaultSensorStorage;
import org.sonar.scanner.storage.Storages;
import static org.sonar.api.batch.InstantiationStrategy.PER_BATCH;
@@ -207,7 +209,6 @@ public class ProjectScanContainer extends ComponentContainer {
IssueFilters.class,
IssuePublisher.class,
-
// metrics
DefaultMetricFinder.class,
@@ -268,6 +269,10 @@ public class ProjectScanContainer extends ComponentContainer {
ScmConfiguration.class,
ScmPublisher.class,
+ // Sensors
+ DefaultSensorStorage.class,
+ DefaultFileLinesContextFactory.class,
+
// Filesystem
DefaultProjectFileSystem.class,
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ScanProperties.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ScanProperties.java
index 8dceea747fc..1da90cf6bf7 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ScanProperties.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ScanProperties.java
@@ -22,7 +22,6 @@ package org.sonar.scanner.scan;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.fs.internal.DefaultInputProject;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.MessageException;
@@ -33,7 +32,6 @@ import static org.sonar.core.config.ScannerProperties.ORGANIZATION;
/**
* Properties that can be passed to the scanners and are not exposed in SonarQube.
*/
-@ScannerSide
public class ScanProperties {
public static final String METADATA_FILE_PATH_KEY = "sonar.scanner.metadataFilePath";
public static final String KEEP_REPORT_PROP_KEY = "sonar.scanner.keepReport";
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchConfigurationLoader.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchConfigurationLoader.java
index 7949d5f07b4..149afa02eda 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchConfigurationLoader.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchConfigurationLoader.java
@@ -21,11 +21,9 @@ package org.sonar.scanner.scan.branch;
import java.util.Map;
import java.util.function.Supplier;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public interface BranchConfigurationLoader {
BranchConfiguration load(Map<String, String> localSettings, Supplier<Map<String, String>> remoteSettingsSupplier, ProjectBranches branches, ProjectPullRequests pullRequests);
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchParamsValidator.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchParamsValidator.java
index 587e6aedb8d..fc5b955bf36 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchParamsValidator.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/BranchParamsValidator.java
@@ -21,11 +21,9 @@ package org.sonar.scanner.scan.branch;
import java.util.List;
import javax.annotation.Nullable;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public interface BranchParamsValidator {
void validate(List<String> validationMessages, @Nullable String deprecatedBranchName);
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranchesLoader.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranchesLoader.java
index a7e6a2bc1bd..b06df550dd4 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranchesLoader.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectBranchesLoader.java
@@ -19,11 +19,9 @@
*/
package org.sonar.scanner.scan.branch;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public interface ProjectBranchesLoader {
/**
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectPullRequestsLoader.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectPullRequestsLoader.java
index c5af1c53375..26a12191844 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectPullRequestsLoader.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/branch/ProjectPullRequestsLoader.java
@@ -19,11 +19,9 @@
*/
package org.sonar.scanner.scan.branch;
-import org.sonar.api.batch.InstantiationStrategy;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
@ScannerSide
-@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public interface ProjectPullRequestsLoader {
/**
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/measure/MeasureCache.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/measure/MeasureCache.java
index c6a904fdfc2..68b30bf84f9 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/measure/MeasureCache.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/measure/MeasureCache.java
@@ -21,7 +21,6 @@ package org.sonar.scanner.scan.measure;
import com.google.common.base.Preconditions;
import javax.annotation.CheckForNull;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.batch.measure.MetricFinder;
import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
import org.sonar.scanner.storage.Storage;
@@ -31,7 +30,6 @@ import org.sonar.scanner.storage.Storages;
/**
* Cache of all measures. This cache is shared amongst all project modules.
*/
-@ScannerSide
public class MeasureCache {
private final Storage<DefaultMeasure<?>> cache;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/Storages.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/Storages.java
index 094db8539e4..23827ebe5d0 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/Storages.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/Storages.java
@@ -31,9 +31,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.picocontainer.Startable;
-import org.sonar.api.batch.ScannerSide;
-@ScannerSide
public class Storages implements Startable {
private final Map<String, Exchange> cacheMap = new HashMap<>();
private Persistit persistit;
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/StoragesManager.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/StoragesManager.java
index e69493794bd..3f1b1d9dcbe 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/StoragesManager.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/storage/StoragesManager.java
@@ -26,7 +26,6 @@ import java.io.File;
import java.util.Properties;
import org.picocontainer.Startable;
import org.slf4j.LoggerFactory;
-import org.sonar.api.batch.ScannerSide;
import org.sonar.api.utils.TempFolder;
import static org.sonar.core.util.FileUtils.deleteQuietly;
@@ -36,7 +35,6 @@ import static org.sonar.core.util.FileUtils.deleteQuietly;
*
* @since 3.6
*/
-@ScannerSide
public class StoragesManager implements Startable {
private File tempDir;
private Persistit persistit;
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstallerTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstallerTest.java
index 4608102c472..03a3ff279b9 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstallerTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/extension/ScannerCoreExtensionsInstallerTest.java
@@ -27,7 +27,7 @@ import java.lang.annotation.Target;
import java.util.stream.Stream;
import org.junit.Test;
import org.sonar.api.SonarRuntime;
-import org.sonar.api.batch.ScannerSide;
+import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.core.extension.CoreExtension;