}
});
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;
}
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";
}
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);
}
}
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();
}