Fix MVC runtime hints.

Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek-sharma@broadcom.com>

# Conflicts:
#	spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcRuntimeHintsProcessor.java
This commit is contained in:
Olga Maciaszek-Sharma
2025-05-29 15:31:48 +02:00
parent 536b073f00
commit cb06e3f230

View File

@@ -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<Class<?>> 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),