From 92494486825495e2a47dd7dc77789f1726ca0b28 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Thu, 13 Jun 2013 09:15:37 +0200 Subject: [PATCH] Fix some quality flaws --- .../java/org/sonar/batch/profiling/AbstractTimeProfiling.java | 4 +++- .../org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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) { -- 2.39.5