Deprecate MvcRequestMatcher

This commit is contained in:
Josh Cummings 2025-01-16 12:43:08 -07:00
parent ae29d07ee2
commit 772f0cc741
No known key found for this signature in database
GPG Key ID: 869B37A20E876129

View File

@ -23,6 +23,7 @@ import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.HttpMethod;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcherBuilder;
import org.springframework.security.web.util.matcher.RequestVariablesExtractor;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.PathMatcher;
@ -46,7 +47,9 @@ import org.springframework.web.util.UrlPathHelper;
* @author Eddú Meléndez
* @author Evgeniy Cheban
* @since 4.1.1
* @deprecated Use {@link PathPatternRequestMatcher} instead.
*/
@Deprecated
public class MvcRequestMatcher implements RequestMatcher, RequestVariablesExtractor {
private final DefaultMatcher defaultMatcher = new DefaultMatcher();
@ -197,7 +200,7 @@ public class MvcRequestMatcher implements RequestMatcher, RequestVariablesExtrac
* @author Marcus Da Coregio
* @since 5.8
*/
public static final class Builder {
public static final class Builder implements RequestMatcherBuilder {
private final HandlerMappingIntrospector introspector;
@ -237,6 +240,7 @@ public class MvcRequestMatcher implements RequestMatcher, RequestVariablesExtrac
* @param pattern the patterns used to match
* @return the generated {@link MvcRequestMatcher}
*/
@Override
public MvcRequestMatcher pattern(HttpMethod method, String pattern) {
MvcRequestMatcher mvcRequestMatcher = new MvcRequestMatcher(this.introspector, pattern);
mvcRequestMatcher.setServletPath(this.servletPath);