aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-30 14:48:07 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-30 15:59:44 +0200
commitae4c7b72d7d9b64a970bad102606b398e61b2243 (patch)
tree1363e153cfbaf7017e50dd126606cac5725ee622 /sonar-batch
parente6c4f6cab7fd2a2b386050fe719a7b448d5c04f2 (diff)
downloadsonarqube-ae4c7b72d7d9b64a970bad102606b398e61b2243.tar.gz
sonarqube-ae4c7b72d7d9b64a970bad102606b398e61b2243.zip
Remove useless constructors with System2.INSTANCE
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java7
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/ProjectScanContainerTest.java2
3 files changed, 5 insertions, 8 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
index 8dc520e3d9d..af2d888c854 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/ModuleProfiling.java
@@ -25,7 +25,7 @@ import org.sonar.api.utils.System2;
import org.sonar.batch.phases.Phases;
import org.sonar.batch.phases.Phases.Phase;
-import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -38,7 +38,7 @@ public class ModuleProfiling extends AbstractTimeProfiling {
private Map<String, ItemProfiling> profilingPerBatchStep = new LinkedHashMap<String, ItemProfiling>();
private final Project module;
- public ModuleProfiling(@CheckForNull Project module, System2 system) {
+ public ModuleProfiling(@Nullable Project module, System2 system) {
super(system);
this.module = module;
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
index a31cc144830..c2eec6f34a5 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java
@@ -60,10 +60,6 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
private final System2 system;
- public PhasesSumUpTimeProfiler() {
- this(System2.INSTANCE);
- }
-
static void println(String msg) {
LOG.info(msg);
}
@@ -77,8 +73,7 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
println(sb.toString());
}
- @VisibleForTesting
- PhasesSumUpTimeProfiler(System2 system) {
+ public PhasesSumUpTimeProfiler(System2 system) {
this.totalProfiling = new ModuleProfiling(null, system);
this.system = system;
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectScanContainerTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectScanContainerTest.java
index 8f585fd36c4..7f01b5fb55d 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectScanContainerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/ProjectScanContainerTest.java
@@ -31,6 +31,7 @@ import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.api.config.Settings;
import org.sonar.api.platform.ComponentContainer;
import org.sonar.api.task.TaskExtension;
+import org.sonar.api.utils.System2;
import org.sonar.batch.bootstrap.ExtensionInstaller;
import org.sonar.batch.profiling.PhasesSumUpTimeProfiler;
import org.sonar.batch.scan.maven.MavenPluginExecutor;
@@ -53,6 +54,7 @@ public class ProjectScanContainerTest {
settings = new Settings();
parentContainer = new ComponentContainer();
parentContainer.add(settings);
+ parentContainer.add(System2.INSTANCE);
container = new ProjectScanContainer(parentContainer);
}