fleetd #609 review: repair a garbled comment carried over from the brief
The brief's sentence about a null token count at HIGH was broken, and the worker copied it into the source verbatim. The code was already right; only the comment was unreadable. Says what is actually true: a HIGH reading always carries a non-null token count today, because LeadContextGauge only reaches HIGH by comparing a number against HIGH_THRESHOLD_TOKENS. That invariant lives in another class and nothing asserts it, so the branch stays.
This commit is contained in:
@@ -360,8 +360,10 @@ public final class LeadHeartbeatLoop {
|
||||
sb.append(": ").append(reading.tokens()).append(" tokens used, ")
|
||||
.append(reading.compactions()).append(' ').append(compactionWord).append(" so far.");
|
||||
} else {
|
||||
// tokens() can be null even at HIGH is not true today, but do not assume it — leave the
|
||||
// token clause out rather than print "null tokens".
|
||||
// A HIGH reading always carries a non-null token count today: LeadContextGauge only
|
||||
// reaches HIGH by comparing a number against HIGH_THRESHOLD_TOKENS. That invariant
|
||||
// lives in another class and nothing asserts it, so this branch does not rely on it —
|
||||
// it drops the token clause rather than printing "null tokens".
|
||||
sb.append(" (").append(reading.compactions()).append(' ').append(compactionWord)
|
||||
.append(" so far).");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user