diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-01-07 12:04:37 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-01-07 12:04:37 +0100 |
commit | 720ecca97f6fff64df514446fc6fc84d6242f15f (patch) | |
tree | eb8455cb19a9370c490f6f3c16aa0be544d78fc0 | |
parent | b4e4f1f9b3e6b888729ccd94c46d1a34ce99c012 (diff) | |
download | sonarqube-720ecca97f6fff64df514446fc6fc84d6242f15f.tar.gz sonarqube-720ecca97f6fff64df514446fc6fc84d6242f15f.zip |
Fix quality flaws
5 files changed, 5 insertions, 5 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java index 6df77203f72..8ca7d3d0731 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java @@ -78,7 +78,7 @@ public class CheckAlertThresholds implements Decorator { public boolean shouldExecuteOnProject(Project project) { return profile != null && profile.getAlerts() != null - && profile.getAlerts().size() > 0 + && !profile.getAlerts().isEmpty() && ResourceUtils.isRootProject(project); } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java index 9786b35eeee..73b79c58c3d 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/GenerateAlertEvents.java @@ -46,7 +46,7 @@ public class GenerateAlertEvents implements Decorator { } public boolean shouldExecuteOnProject(Project project) { - return profile != null && profile.getAlerts() != null && profile.getAlerts().size() > 0; + return profile != null && profile.getAlerts() != null && !profile.getAlerts().isEmpty(); } @DependsUpon diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectExclusions.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectExclusions.java index 10179b33102..36f4c7b85e0 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectExclusions.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectExclusions.java @@ -58,7 +58,7 @@ public class ProjectExclusions implements TaskComponent { } public void apply() { - if (reactor.getProjects().size() > 0 && StringUtils.isNotBlank(reactor.getProjects().get(0).getKey())) { + if (!reactor.getProjects().isEmpty() && StringUtils.isNotBlank(reactor.getProjects().get(0).getKey())) { LOG.info("Apply project exclusions"); for (ProjectDefinition project : reactor.getProjects()) { if (isExcluded(key(project), project == reactor.getRoot())) { diff --git a/sonar-graph/src/main/java/org/sonar/graph/IncrementalCyclesAndFESSolver.java b/sonar-graph/src/main/java/org/sonar/graph/IncrementalCyclesAndFESSolver.java index 7837af3b5e9..9f11a68b8ee 100644 --- a/sonar-graph/src/main/java/org/sonar/graph/IncrementalCyclesAndFESSolver.java +++ b/sonar-graph/src/main/java/org/sonar/graph/IncrementalCyclesAndFESSolver.java @@ -55,7 +55,7 @@ public class IncrementalCyclesAndFESSolver<V> { cycles.addAll(cycleDetector.getCycles()); solver = new MinimumFeedbackEdgeSetSolver(cycles); edgesToExclude = solver.getEdges(); - } while (cycleDetector.getCycles().size() != 0); + } while (!cycleDetector.getCycles().isEmpty()); } public int getWeightOfFeedbackEdgeSet() { diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java index 103dec7edc8..41db8e42fb7 100644 --- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java +++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java @@ -223,7 +223,7 @@ public final class RegisterRules { } private void deleteDeprecatedParameters(Rule persistedRule, Rule rule) { - if (persistedRule.getParams() != null && persistedRule.getParams().size() > 0) { + if (persistedRule.getParams() != null && !persistedRule.getParams().isEmpty()) { for (Iterator<RuleParam> it = persistedRule.getParams().iterator(); it.hasNext(); ) { RuleParam persistedParam = it.next(); if (rule.getParam(persistedParam.getKey()) == null) { |