From 4eff1a91c83ba28942fa25f641352a7dd662a405 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Mon, 8 Aug 2022 18:51:57 +1000 Subject: [PATCH] improve performance of alias checking Signed-off-by: Lachlan Roberts --- .../java/org/eclipse/jetty/server/handler/ContextHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index 597bbd0ea20..9353607d386 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -228,7 +228,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu private final List _contextListeners = new CopyOnWriteArrayList<>(); private final Set _durableListeners = new HashSet<>(); private Index _protectedTargets = Index.empty(false); - private final List _aliasChecks = new CopyOnWriteArrayList<>(); + private final List _aliasChecks = new ArrayList<>(); public enum Availability { @@ -1967,7 +1967,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu LOG.debug("Aliased resource: {}~={}", resource, resource.getAlias()); // alias checks - for (AliasCheck check : getAliasChecks()) + for (AliasCheck check : _aliasChecks) { if (check.check(path, resource)) {