From 87f2deed65371d082e922ebb4a45ac355c73b64b Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 8 Apr 2014 06:11:42 -0700 Subject: [PATCH] Squelching prior notified loop detection --- .../main/java/org/eclipse/jetty/start/PathFinder.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/PathFinder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/PathFinder.java index 5387959b6f0..799ccb193ea 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/PathFinder.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/PathFinder.java @@ -29,11 +29,16 @@ import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; public class PathFinder extends SimpleFileVisitor { + // internal tracking of prior notified paths (to avoid repeated notification of same ignored path) + private static Set NOTIFIED_PATHS = new HashSet<>(); + private boolean includeDirsInResults = false; private Map hits = new HashMap<>(); private Path basePath = null; @@ -149,7 +154,11 @@ public class PathFinder extends SimpleFileVisitor { if (exc instanceof FileSystemLoopException) { - StartLog.warn("skipping detected filesystem loop: " + file); + if (!NOTIFIED_PATHS.contains(file)) + { + StartLog.warn("skipping detected filesystem loop: " + file); + NOTIFIED_PATHS.add(file); + } return FileVisitResult.SKIP_SUBTREE; } else