diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-06-20 13:52:28 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-06-20 13:52:57 +0200 |
commit | 45ae7835e43c8ac6f676a5a50eb164d7a8a4e9d5 (patch) | |
tree | 75731853280180dc1555b9290d75e668aa3b7191 /sonar-plugin-api | |
parent | 472945cdd2331f0b1bf7eddeee1c744f588b4e2d (diff) | |
download | sonarqube-45ae7835e43c8ac6f676a5a50eb164d7a8a4e9d5.tar.gz sonarqube-45ae7835e43c8ac6f676a5a50eb164d7a8a4e9d5.zip |
Fix Quality flaws
Diffstat (limited to 'sonar-plugin-api')
3 files changed, 7 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java index 602d8ebeb1a..44917519e72 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/debt/DebtRemediationFunction.java @@ -85,10 +85,10 @@ public class DebtRemediationFunction { if (type != that.type) { return false; } - if (coefficient != null ? !coefficient.equals(that.coefficient) : that.coefficient != null) { + if ((coefficient != null) ? !coefficient.equals(that.coefficient) : (that.coefficient != null)) { return false; } - return offset != null ? offset.equals(that.offset) : that.offset == null; + return (offset != null) ? offset.equals(that.offset) : (that.offset == null); } @Override diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java index b0f397623fc..c3ef537cac2 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java @@ -19,12 +19,12 @@ */ package org.sonar.api.batch.sensor.coverage; -import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; import org.sonar.api.measures.Metric; +import static java.util.Arrays.asList; import static org.sonar.api.measures.CoreMetrics.CONDITIONS_BY_LINE; import static org.sonar.api.measures.CoreMetrics.CONDITIONS_TO_COVER; import static org.sonar.api.measures.CoreMetrics.COVERAGE_LINE_HITS_DATA; @@ -79,8 +79,8 @@ public enum CoverageType { this.uncoveredConditions = uncoveredConditions; this.coveredConditionsByLine = coveredConditionsByLine; this.conditionsByLine = conditionsByLine; - this.all = Collections - .unmodifiableSet(new LinkedHashSet<>(Arrays.asList(linesToCover, uncoveredLines, lineHitsData, conditionsToCover, uncoveredConditions, coveredConditionsByLine, conditionsByLine))); + this.all = Collections.unmodifiableSet(new LinkedHashSet<>( + asList(linesToCover, uncoveredLines, lineHitsData, conditionsToCover, uncoveredConditions, coveredConditionsByLine, conditionsByLine))); } public Set<Metric> allMetrics() { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rule/Severity.java b/sonar-plugin-api/src/main/java/org/sonar/api/rule/Severity.java index 385b3a2b32e..8faf14504fa 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rule/Severity.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rule/Severity.java @@ -22,6 +22,7 @@ package org.sonar.api.rule; import java.util.List; import static java.util.Arrays.asList; +import static java.util.Collections.unmodifiableList; /** * @since 3.6 @@ -37,7 +38,7 @@ public final class Severity { /** * All the supported severity values, ordered from {@link #INFO} to {@link #BLOCKER}. */ - public static final List<String> ALL = asList(INFO, MINOR, MAJOR, CRITICAL, BLOCKER); + public static final List<String> ALL = unmodifiableList(asList(INFO, MINOR, MAJOR, CRITICAL, BLOCKER)); private Severity() { // utility |