aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-06-26 11:30:53 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-06-26 11:31:12 +0200
commit61e3e7a2551b42c4ede37cbdee5392e1d93d6a31 (patch)
treea0753923bcb00bd84abace89fed5177e5aa74367 /sonar-batch
parentaae644fd6f1344fa9f304627335534485862ac04 (diff)
downloadsonarqube-61e3e7a2551b42c4ede37cbdee5392e1d93d6a31.tar.gz
sonarqube-61e3e7a2551b42c4ede37cbdee5392e1d93d6a31.zip
Fix some quality flaws
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java26
2 files changed, 4 insertions, 24 deletions
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 e8402e2b7be..ad1a9d7bc6d 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
@@ -53,7 +53,7 @@ import static org.sonar.batch.profiling.AbstractTimeProfiling.truncate;
public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorExecutionHandler, DecoratorExecutionHandler, PostJobExecutionHandler, DecoratorsPhaseHandler,
SensorsPhaseHandler, PostJobsPhaseHandler, MavenPhaseHandler, InitializersPhaseHandler, InitializerExecutionHandler, BatchStepHandler {
- static Logger LOG = LoggerFactory.getLogger(PhasesSumUpTimeProfiler.class);
+ final static Logger LOG = LoggerFactory.getLogger(PhasesSumUpTimeProfiler.class);
private static final int TEXT_RIGHT_PAD = 60;
private static final int TIME_LEFT_PAD = 10;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java b/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
index 9c504dbe35a..43cda3afbd3 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/profiling/PhasesSumUpTimeProfilerTest.java
@@ -42,7 +42,7 @@ import org.sonar.api.batch.events.SensorsPhaseHandler;
import org.sonar.api.batch.events.SensorsPhaseHandler.SensorsPhaseEvent;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
-import org.sonar.batch.events.BatchStepHandler;
+import org.sonar.batch.events.BatchStepEvent;
import org.sonar.batch.phases.Phases.Phase;
import java.util.Arrays;
@@ -188,10 +188,10 @@ public class PhasesSumUpTimeProfilerTest {
private void batchStep(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
// Start of batch step
- profiler.onBatchStep(batchStepEvent(true, "Free memory"));
+ profiler.onBatchStep(new BatchStepEvent("Free memory", true));
clock.sleep(9);
// End of batch step
- profiler.onBatchStep(batchStepEvent(false, "Free memory"));
+ profiler.onBatchStep(new BatchStepEvent("Free memory", false));
}
private void mavenPhase(PhasesSumUpTimeProfiler profiler) throws InterruptedException {
@@ -341,26 +341,6 @@ public class PhasesSumUpTimeProfilerTest {
};
}
- private BatchStepHandler.BatchStepEvent batchStepEvent(final boolean start, final String stepName) {
- return new BatchStepHandler.BatchStepEvent() {
-
- @Override
- public boolean isStart() {
- return start;
- }
-
- @Override
- public boolean isEnd() {
- return !start;
- }
-
- @Override
- public String stepName() {
- return stepName;
- }
- };
- }
-
private MavenPhaseHandler.MavenPhaseEvent mavenEvent(final boolean start) {
return new MavenPhaseHandler.MavenPhaseEvent() {