Ignored exception in #715

This commit is contained in:
Rsl1122 2018-08-30 17:52:50 +03:00
parent be2be530ca
commit bee9966450
2 changed files with 22 additions and 18 deletions

View File

@ -57,20 +57,13 @@ public class TimeAmountFormatter implements Formatter<Long> {
return formattedTime; return formattedTime;
} }
private void appendSeconds(StringBuilder builder, long seconds, long minutes, long hours, String fHours, String fMinutes, String fSeconds) { private void appendHours(StringBuilder builder, long hours, String fHours) {
if (seconds != 0) { if (hours != 0) {
String s = fSeconds.replace(SECONDS_PH, String.valueOf(seconds)); String h = fHours.replace(HOURS_PH, String.valueOf(hours));
if (minutes == 0 && s.contains(MINUTES_PH)) { if (h.contains(ZERO_PH) && String.valueOf(hours).length() == 1) {
if (hours == 0 && fMinutes.contains(HOURS_PH)) {
builder.append(fHours.replace(ZERO_PH, "0").replace(HOURS_PH, "0"));
}
builder.append(fMinutes.replace(HOURS_PH, "").replace(ZERO_PH, "0").replace(MINUTES_PH, "0"));
}
s = s.replace(MINUTES_PH, "");
if (s.contains(ZERO_PH) && String.valueOf(seconds).length() == 1) {
builder.append('0'); builder.append('0');
} }
builder.append(s); builder.append(h);
} }
} }
@ -89,13 +82,20 @@ public class TimeAmountFormatter implements Formatter<Long> {
} }
} }
private void appendHours(StringBuilder builder, long hours, String fHours) { private void appendSeconds(StringBuilder builder, long seconds, long minutes, long hours, String fHours, String fMinutes, String fSeconds) {
if (hours != 0) { if (seconds != 0) {
String h = fHours.replace(HOURS_PH, String.valueOf(hours)); String s = fSeconds.replace(SECONDS_PH, String.valueOf(seconds));
if (h.contains(ZERO_PH) && String.valueOf(hours).length() == 1) { if (minutes == 0 && s.contains(MINUTES_PH)) {
if (hours == 0 && fMinutes.contains(HOURS_PH)) {
builder.append(fHours.replace(ZERO_PH, "0").replace(HOURS_PH, "0"));
}
builder.append(fMinutes.replace(HOURS_PH, "").replace(ZERO_PH, "0").replace(MINUTES_PH, "0"));
}
s = s.replace(MINUTES_PH, "");
if (s.contains(ZERO_PH) && String.valueOf(seconds).length() == 1) {
builder.append('0'); builder.append('0');
} }
builder.append(h); builder.append(s);
} }
} }

View File

@ -34,7 +34,11 @@ public class LogsFolderCleanTask extends AbsRunnable {
} catch (NullPointerException ignore) { } catch (NullPointerException ignore) {
/* Ignored - not supposed to occur. */ /* Ignored - not supposed to occur. */
} finally { } finally {
cancel(); try {
cancel();
} catch (Exception ignore) {
/* Ignored, TaskCenter concurrent modification exception, will be fixed later in apf-3.3.0. */
}
} }
} }