From 3faa2fcd168a719dc0b2116ae698479d476536db Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 28 Sep 2022 11:25:16 -0500 Subject: [PATCH] Issue #8628 - pseudo restore PathMappings.getMatch(String) + This returns a MappedResource, but not the stored instance, but a new instance of MappedResource every time. + Flagged deprecated APIs for removal as well Signed-off-by: Joakim Erdfelt --- .../java/org/eclipse/jetty/http/pathmap/PathMappings.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java index c2871a58cab..179d2d1bd50 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/pathmap/PathMappings.java @@ -256,10 +256,11 @@ public class PathMappings implements Iterable>, Dumpable /** * @deprecated use {@link #getMatched(String)} instead */ - @Deprecated + @Deprecated(forRemoval = true) public MappedResource getMatch(String path) { - throw new UnsupportedOperationException("Use .getMatched(String) instead"); + MatchedResource matchedPath = getMatched(path); + return new MappedResource<>(matchedPath.getPathSpec(), matchedPath.getResource()); } @Override @@ -271,7 +272,7 @@ public class PathMappings implements Iterable>, Dumpable /** * @deprecated use {@link PathSpec#from(String)} instead */ - @Deprecated + @Deprecated(forRemoval = true) public static PathSpec asPathSpec(String pathSpecString) { return PathSpec.from(pathSpecString);