Skip to content

Commit 6620dea

Browse files
committed
Polishing
See gh-49645
1 parent dd54841 commit 6620dea

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ private static final class CatchAllHandler {
509509
this.responseStatus = responseStatus;
510510
}
511511

512+
@Reflective
512513
Mono<Void> handle(ServerWebExchange exchange) {
513514
ServerHttpResponse response = exchange.getResponse();
514515
response.setStatusCode(this.responseStatus);
@@ -577,7 +578,7 @@ static class AbstractWebFluxEndpointHandlerMappingRuntimeHints implements Runtim
577578
@Override
578579
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
579580
this.reflectiveRegistrar.registerRuntimeHints(hints, WriteOperationHandler.class,
580-
ReadOperationHandler.class);
581+
ReadOperationHandler.class, CatchAllHandler.class);
581582
}
582583

583584
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ private static final class CatchAllHandler {
466466
this.responseStatus = responseStatus;
467467
}
468468

469+
@Reflective
469470
void handle(HttpServletResponse response) {
470471
response.setStatus(this.responseStatus.value());
471472
}
@@ -531,7 +532,7 @@ static class AbstractWebMvcEndpointHandlerMappingRuntimeHints implements Runtime
531532

532533
@Override
533534
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
534-
this.reflectiveRegistrar.registerRuntimeHints(hints, OperationHandler.class);
535+
this.reflectiveRegistrar.registerRuntimeHints(hints, OperationHandler.class, CatchAllHandler.class);
535536
}
536537

537538
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMappingTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ void shouldRegisterHints() {
4545
.onType(TypeReference
4646
.of("org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.ReadOperationHandler")))
4747
.accepts(runtimeHints);
48+
assertThat(RuntimeHintsPredicates.reflection()
49+
.onType(TypeReference
50+
.of("org.springframework.boot.actuate.endpoint.web.reactive.AbstractWebFluxEndpointHandlerMapping.CatchAllHandler")))
51+
.accepts(runtimeHints);
4852
}
4953

5054
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMappingTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ void shouldRegisterHints() {
4040
.onType(TypeReference
4141
.of("org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler")))
4242
.accepts(runtimeHints);
43+
assertThat(RuntimeHintsPredicates.reflection()
44+
.onType(TypeReference
45+
.of("org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.CatchAllHandler")))
46+
.accepts(runtimeHints);
4347
}
4448

4549
}

0 commit comments

Comments
 (0)