From: Julien HENRY Date: Thu, 13 Jun 2013 07:15:37 +0000 (+0200) Subject: Fix some quality flaws X-Git-Tag: 3.7~499 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=92494486825495e2a47dd7dc77789f1726ca0b28;p=sonarqube.git Fix some quality flaws --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java b/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java index badcec28122..81810cd00c3 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java +++ b/sonar-batch/src/main/java/org/sonar/batch/profiling/AbstractTimeProfiling.java @@ -21,6 +21,8 @@ package org.sonar.batch.profiling; import org.sonar.api.utils.TimeUtils; +import javax.annotation.Nullable; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -101,7 +103,7 @@ public abstract class AbstractTimeProfiling { PhasesSumUpTimeProfiler.println(msg); } - protected void println(String text, Double percent, AbstractTimeProfiling phaseProfiling) { + protected void println(String text, @Nullable Double percent, AbstractTimeProfiling phaseProfiling) { PhasesSumUpTimeProfiler.println(text, percent, phaseProfiling); } 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 6aebf4f1b86..e8402e2b7be 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 @@ -40,6 +40,8 @@ import org.sonar.api.utils.TimeUtils; import org.sonar.batch.events.BatchStepHandler; import org.sonar.batch.phases.Phases; +import javax.annotation.Nullable; + import java.util.HashMap; import java.util.IdentityHashMap; import java.util.List; @@ -72,7 +74,7 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx LOG.info(msg); } - static void println(String text, Double percent, AbstractTimeProfiling phaseProfiling) { + static void println(String text, @Nullable Double percent, AbstractTimeProfiling phaseProfiling) { StringBuilder sb = new StringBuilder(); sb.append(StringUtils.rightPad(text, TEXT_RIGHT_PAD)).append(StringUtils.leftPad(phaseProfiling.totalTimeAsString(), TIME_LEFT_PAD)); if (percent != null) {