aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/MetricProvider.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java2
2 files changed, 4 insertions, 0 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/MetricProvider.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/MetricProvider.java
index 59e626ab417..d9565f1ed9c 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/MetricProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/MetricProvider.java
@@ -22,12 +22,14 @@ package org.sonar.batch.bootstrap;
import com.google.common.collect.Lists;
import org.sonar.api.BatchComponent;
import org.sonar.api.ExtensionProvider;
+import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
import org.sonar.api.measures.Metrics;
import java.util.List;
+@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public class MetricProvider extends ExtensionProvider implements BatchComponent {
private Metrics[] factories;
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 969c726d98d..fe0170eac4e 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,12 +21,14 @@ package org.sonar.api.measures;
import org.sonar.api.BatchExtension;
import org.sonar.api.ServerExtension;
+import org.sonar.api.batch.InstantiationStrategy;
import java.util.List;
/**
* @since 1.10
*/
+@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public interface Metrics extends BatchExtension, ServerExtension {
List<Metric> getMetrics();
}