From cb06e3f230a9655bf9bd5f16be463e46b969c087 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Thu, 29 May 2025 15:31:48 +0200 Subject: [PATCH] Fix MVC runtime hints. Signed-off-by: Olga Maciaszek-Sharma # Conflicts: # spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcRuntimeHintsProcessor.java --- .../server/mvc/config/GatewayMvcRuntimeHintsProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcRuntimeHintsProcessor.java b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcRuntimeHintsProcessor.java index fb78da79..17382ab6 100644 --- a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcRuntimeHintsProcessor.java +++ b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcRuntimeHintsProcessor.java @@ -33,6 +33,7 @@ import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContrib import org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.cloud.gateway.server.mvc.filter.FilterFunctions; import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; import org.springframework.core.type.filter.AssignableTypeFilter; @@ -73,7 +74,8 @@ public class GatewayMvcRuntimeHintsProcessor implements BeanFactoryInitializatio ReflectionHints hints = generationContext.getRuntimeHints().reflection(); Set> typesToRegister = Stream .of(getTypesToRegister(GATEWAY_MVC_FILTER_PACKAGE_NAME), - getTypesToRegister(GATEWAY_MVC_PREDICATE_PACKAGE_NAME), PROPERTIES) + getTypesToRegister(GATEWAY_MVC_PREDICATE_PACKAGE_NAME), PROPERTIES, + new HashSet<>(Collections.singletonList(FilterFunctions.class))) .flatMap(Set::stream) .collect(Collectors.toSet()); typesToRegister.forEach(clazz -> hints.registerType(TypeReference.of(clazz),