Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org> (cherry picked from commit f86de6f76a3079c2655df9b242fc968edfb17b9d)
@@ -271,9 +271,9 @@ public class TrashPolicyDefault extends TrashPolicy {
public void run() {
if (emptierInterval == 0)
return; // trash disabled
- long now = Time.now();
- long end;
+ long now, end;
while (true) {
+ now = Time.now();
end = ceiling(now, emptierInterval);
try { // sleep for interval
Thread.sleep(end - now);