aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-05-07 15:20:08 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-05-07 15:20:08 +0200
commitf7c5f42cf3ca81ff948ae08afe50d15c09412bfc (patch)
tree67a180d697e13b419b7741466fceaa6f5806f5bb
parent223cca42ca4f24a6d5790077eb0e638d421276f4 (diff)
downloadsonarqube-f7c5f42cf3ca81ff948ae08afe50d15c09412bfc.tar.gz
sonarqube-f7c5f42cf3ca81ff948ae08afe50d15c09412bfc.zip
Fix quality flaws
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelOperations.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/debt/DebtDecorator.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java6
4 files changed, 7 insertions, 7 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelOperations.java b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelOperations.java
index 1a264f90ba5..e4014d29559 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelOperations.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelOperations.java
@@ -172,8 +172,8 @@ public class DebtModelOperations implements ServerComponent {
}
});
Integer nextPosition = moveUpOrDown ?
- ((currentPosition > 0) ? (currentPosition - 1) : null) :
- ((currentPosition < (rootCharacteristics.size() - 1)) ? (currentPosition + 1) : null);
+ (currentPosition > 0 ? currentPosition - 1 : null) :
+ ((currentPosition < rootCharacteristics.size() - 1) ? currentPosition + 1 : null);
return (nextPosition != null) ? Iterables.get(rootCharacteristics, nextPosition) : null;
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java
index 08f8209bbd1..584234f1e3a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java
@@ -123,7 +123,7 @@ class MeasureFilterSort {
private String getMetricColumn() {
if (metric.isNumericType()) {
- return (period != null) ? ("pmsort.variation_value_" + period) : "pmsort.value";
+ return period != null ? "pmsort.variation_value_" + period : "pmsort.value";
} else {
return "pmsort.text_value";
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/debt/DebtDecorator.java b/sonar-batch/src/main/java/org/sonar/batch/debt/DebtDecorator.java
index d9912f45b4b..f4521d664a6 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/debt/DebtDecorator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/debt/DebtDecorator.java
@@ -202,7 +202,7 @@ public final class DebtDecorator implements Decorator {
public void add(@Nullable E key, Long value) {
if (key != null) {
Long currentValue = sumByKeys.get(key);
- sumByKeys.put(key, (currentValue != null) ? (currentValue + value) : value);
+ sumByKeys.put(key, currentValue != null ? currentValue + value : value);
}
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
index 9089c441836..05f2ba422d5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
@@ -114,15 +114,15 @@ public class Durations implements BatchComponent, ServerComponent {
private String format(Locale locale, int days, int hours, int minutes, boolean isNegative){
StringBuilder message = new StringBuilder();
if (days > 0) {
- message.append(message(locale, "work_duration.x_days", isNegative ? (-1 * days) : days));
+ message.append(message(locale, "work_duration.x_days", isNegative ? -1 * days : days));
}
if (displayHours(days, hours)) {
addSpaceIfNeeded(message);
- message.append(message(locale, "work_duration.x_hours", (isNegative && message.length() == 0) ? (-1 * hours) : hours));
+ message.append(message(locale, "work_duration.x_hours", isNegative && message.length() == 0 ? -1 * hours : hours));
}
if (displayMinutes(days, hours, minutes)) {
addSpaceIfNeeded(message);
- message.append(message(locale, "work_duration.x_minutes", (isNegative && message.length() == 0) ? (-1 * minutes) : minutes));
+ message.append(message(locale, "work_duration.x_minutes", isNegative && message.length() == 0 ? -1 * minutes : minutes));
}
return message.toString();
}