Watchdog: Fix potential IllegalFormatException (#1508)

If an epoch name contains a % symbol, this could've lead to an exception
at runtime where the number of arguments mismatches the format string.
This commit is contained in:
David Vo
2018-12-25 18:12:44 +11:00
committed by Peter Johnson
parent a7f4e29b73
commit 8d95c38e39

View File

@@ -155,7 +155,7 @@ public class Watchdog implements Closeable, Comparable<Watchdog> {
if (now - m_lastEpochsPrintTime > kMinPrintPeriod) {
m_lastEpochsPrintTime = now;
m_epochs.forEach((key, value) -> {
System.out.format("\t" + key + ": %.6fs\n", value / 1.0e6);
System.out.format("\t%s: %.6fs\n", key, value / 1.0e6);
});
}
}