Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private class CleanupVisitor implements FileVisitor<Path> {
private final Instant cutoff;
private final Instant timeoutTarget;

private boolean terminated;
private boolean terminated = false;

CleanupVisitor(boolean cleanSelf, long timeout, TimeUnit unit) {
this.cleanSelf = cleanSelf;
Expand Down Expand Up @@ -107,7 +107,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
// the JFR repository directories are under <basedir>/pid_<pid>
String pid = fileName.startsWith("pid_") ? fileName.substring(4) : null;
boolean isSelfPid = pid != null && pid.equals(PidHelper.getPid());
shouldClean |= (cleanSelf && isSelfPid) || (!cleanSelf && !pidSet.contains(pid));
shouldClean |= cleanSelf ? isSelfPid : !isSelfPid && !pidSet.contains(pid);
if (shouldClean) {
log.debug("Cleaning temporary location {}", dir);
}
Expand Down
Loading