From 6620dea347a522d160d725a6a51e4ca3a54e1142 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Thu, 19 Mar 2026 09:25:44 +0100 Subject: [PATCH] Polishing See gh-49645 --- .../web/reactive/AbstractWebFluxEndpointHandlerMapping.java | 3 ++- .../web/servlet/AbstractWebMvcEndpointHandlerMapping.java | 3 ++- .../reactive/AbstractWebFluxEndpointHandlerMappingTests.java | 4 ++++ .../servlet/AbstractWebMvcEndpointHandlerMappingTests.java | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java index 4d9da585699..84044f23b8d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java @@ -509,6 +509,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi this.responseStatus = responseStatus; } + @Reflective Mono handle(ServerWebExchange exchange) { ServerHttpResponse response = exchange.getResponse(); response.setStatusCode(this.responseStatus); @@ -577,7 +578,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { this.reflectiveRegistrar.registerRuntimeHints(hints, WriteOperationHandler.class, - ReadOperationHandler.class); + ReadOperationHandler.class, CatchAllHandler.class); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index 66cd1eef84f..c6cecfe2ebe 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -466,6 +466,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin this.responseStatus = responseStatus; } + @Reflective void handle(HttpServletResponse response) { response.setStatus(this.responseStatus.value()); } @@ -531,7 +532,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { - this.reflectiveRegistrar.registerRuntimeHints(hints, OperationHandler.class); + this.reflectiveRegistrar.registerRuntimeHints(hints, OperationHandler.class, CatchAllHandler.class); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java index 9264a463b44..ad094ff1964 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java @@ -45,6 +45,10 @@ class AbstractWebFluxEndpointHandlerMappingTests { .onType(TypeReference .of("org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.ReadOperationHandler"))) .accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.reflection() + .onType(TypeReference + .of("org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.CatchAllHandler"))) + .accepts(runtimeHints); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java index d986b6b2c1a..9b85dcafb5e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java @@ -40,6 +40,10 @@ class AbstractWebMvcEndpointHandlerMappingTests { .onType(TypeReference .of("org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler"))) .accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.reflection() + .onType(TypeReference + .of("org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.CatchAllHandler"))) + .accepts(runtimeHints); } }