diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-04-27 12:11:55 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-04-27 12:11:55 +0200 |
commit | 30e34a064dad8df08fcb72cfd25310ee7e95fc5e (patch) | |
tree | 7aefb22de96cbbcf261d03a0e12b09e4a0725b3d /sonar-plugin-api/src/main | |
parent | 65d4574e420483ae06fed9d9a3af82ce2bd0b344 (diff) | |
download | sonarqube-30e34a064dad8df08fcb72cfd25310ee7e95fc5e.tar.gz sonarqube-30e34a064dad8df08fcb72cfd25310ee7e95fc5e.zip |
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api/src/main')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java | 6 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java index bdda2b6a865..06d2c2b53bb 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/technicaldebt/server/internal/DefaultCharacteristic.java @@ -328,7 +328,7 @@ public class DefaultCharacteristic implements Characteristic { DefaultCharacteristic that = (DefaultCharacteristic) o; - if (key != null ? !key.equals(that.key) : that.key != null) { + if ((key != null) ? !key.equals(that.key) : (that.key != null)) { return false; } return !(ruleKey != null ? !ruleKey.equals(that.ruleKey) : that.ruleKey != null); @@ -337,8 +337,8 @@ public class DefaultCharacteristic implements Characteristic { @Override public int hashCode() { - int result = key != null ? key.hashCode() : 0; - result = 31 * result + (ruleKey != null ? ruleKey.hashCode() : 0); + int result = (key != null) ? key.hashCode() : 0; + result = 31 * result + ((ruleKey != null) ? ruleKey.hashCode() : 0); return result; } 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 a181b788b75..9089c441836 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 @@ -27,6 +27,7 @@ import org.sonar.api.config.Settings; import org.sonar.api.i18n.I18n; import javax.annotation.CheckForNull; + import java.util.Locale; /** @@ -113,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(); } |