diff --git a/src/main/java/ru/vyarus/gradle/frontend/core/util/DurationFormatter.java b/src/main/java/ru/vyarus/gradle/frontend/core/util/DurationFormatter.java index 00dc522..e1bc072 100644 --- a/src/main/java/ru/vyarus/gradle/frontend/core/util/DurationFormatter.java +++ b/src/main/java/ru/vyarus/gradle/frontend/core/util/DurationFormatter.java @@ -55,7 +55,7 @@ public static String format(final long duration) { boolean secs = false; if (remain >= MILLIS_PER_SECOND) { // if only secs, show rounded value, otherwise get rid of ms - final int secondsScale = result.isEmpty() ? 2 : 0; + final int secondsScale = result.length() == 0 ? 2 : 0; append(result, BigDecimal.valueOf(remain) .divide(BigDecimal.valueOf(MILLIS_PER_SECOND)) .setScale(secondsScale, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(), "s");