Deprecate HandlerMappingIntrospector

Closes gh-34019
This commit is contained in:
rstoyanchev
2025-01-10 18:49:57 +00:00
parent dc98a7960a
commit 8c03d55905
10 changed files with 28 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -280,6 +280,7 @@ public abstract class MvcNamespaceUtils {
* Registers an {@link HandlerMappingIntrospector} under a well-known name
* unless already registered.
*/
@SuppressWarnings("removal")
private static void registerHandlerMappingIntrospector(ParserContext context, @Nullable Object source) {
if (!context.getRegistry().containsBeanDefinition(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
RootBeanDefinition beanDef = new RootBeanDefinition(HandlerMappingIntrospector.class);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1172,6 +1172,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
protected void addCorsMappings(CorsRegistry registry) {
}
@SuppressWarnings("removal")
@Bean
@Lazy
public HandlerMappingIntrospector mvcHandlerMappingIntrospector() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
* @author Brian Clozel
* @since 5.2
*/
@SuppressWarnings("removal")
public class RouterFunctionMapping extends AbstractHandlerMapping implements InitializingBean, MatchableHandlerMapping {
private @Nullable RouterFunction<?> routerFunction;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,6 +61,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
* @author Arjen Poutsma
* @since 16.04.2003
*/
@SuppressWarnings("removal")
public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping implements MatchableHandlerMapping {
private @Nullable Object rootHandler;

View File

@@ -90,7 +90,12 @@ import org.springframework.web.util.pattern.PathPatternParser;
*
* @author Rossen Stoyanchev
* @since 4.3.1
* @deprecated in favor of using just {@link PathPatternParser}; when
* {@link #allHandlerMappingsUsePathPatternParser} returns true, it is sufficient
* to use that to align with handler mappings.
*/
@SuppressWarnings("removal")
@Deprecated(since = "7.0", forRemoval = true)
public class HandlerMappingIntrospector
implements CorsConfigurationSource, PreFlightRequestHandler, ApplicationContextAware, InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,8 +31,9 @@ import org.springframework.web.util.pattern.PathPatternParser;
*
* @author Rossen Stoyanchev
* @since 4.3.1
* @see HandlerMappingIntrospector
* @deprecated together with {@link HandlerMappingIntrospector} without a replacement.
*/
@Deprecated(since = "7.0", forRemoval = true)
public interface MatchableHandlerMapping extends HandlerMapping {
/**
@@ -55,6 +56,7 @@ public interface MatchableHandlerMapping extends HandlerMapping {
* for use at runtime in web modules in favor of parsed patterns with
* {@link PathPatternParser}.
*/
@SuppressWarnings("removal")
@Deprecated(since = "7.0", forRemoval = true)
@Nullable RequestMatchResult match(HttpServletRequest request, String pattern);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,10 @@ import org.springframework.web.util.pattern.PathPatternParser;
*
* @author Rossen Stoyanchev
* @since 5.3
* @deprecated together with {@link HandlerMappingIntrospector} without a replacement.
*/
@SuppressWarnings("removal")
@Deprecated(since = "7.0", forRemoval = true)
class PathPatternMatchableHandlerMapping implements MatchableHandlerMapping {
private static final int MAX_PATTERNS = 1024;

View File

@@ -34,7 +34,10 @@ import org.springframework.web.util.pattern.PathPatternParser;
*
* @author Rossen Stoyanchev
* @since 4.3.1
* @deprecated together with {@link HandlerMappingIntrospector} without a replacement.
*/
@SuppressWarnings("removal")
@Deprecated(since = "7.0", forRemoval = true)
public class RequestMatchResult {
private final @Nullable PathPattern pathPattern;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,6 +71,7 @@ import org.springframework.web.util.UrlPathHelper;
* @author Olga Maciaszek-Sharma
* @since 3.1
*/
@SuppressWarnings("removal")
public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMapping
implements MatchableHandlerMapping, EmbeddedValueResolverAware {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -73,6 +73,7 @@ import static org.springframework.web.servlet.HandlerMapping.BEST_MATCHING_PATTE
* @author Rossen Stoyanchev
* @since 4.3.1
*/
@SuppressWarnings("removal")
class HandlerMappingIntrospectorTests {
@Test