Avoid repeated calls of WebFlux and MVC registrations' getters
See gh-23999
This commit is contained in:
parent
f9ff39a7a6
commit
2aac5c0095
|
|
@ -248,18 +248,22 @@ public class WebFluxAutoConfiguration {
|
|||
|
||||
@Override
|
||||
protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() {
|
||||
if (this.webFluxRegistrations != null
|
||||
&& this.webFluxRegistrations.getRequestMappingHandlerAdapter() != null) {
|
||||
return this.webFluxRegistrations.getRequestMappingHandlerAdapter();
|
||||
if (this.webFluxRegistrations != null) {
|
||||
RequestMappingHandlerAdapter adapter = this.webFluxRegistrations.getRequestMappingHandlerAdapter();
|
||||
if (adapter != null) {
|
||||
return adapter;
|
||||
}
|
||||
}
|
||||
return super.createRequestMappingHandlerAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
|
||||
if (this.webFluxRegistrations != null
|
||||
&& this.webFluxRegistrations.getRequestMappingHandlerMapping() != null) {
|
||||
return this.webFluxRegistrations.getRequestMappingHandlerMapping();
|
||||
if (this.webFluxRegistrations != null) {
|
||||
RequestMappingHandlerMapping mapping = this.webFluxRegistrations.getRequestMappingHandlerMapping();
|
||||
if (mapping != null) {
|
||||
return mapping;
|
||||
}
|
||||
}
|
||||
return super.createRequestMappingHandlerMapping();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,8 +402,11 @@ public class WebMvcAutoConfiguration {
|
|||
|
||||
@Override
|
||||
protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() {
|
||||
if (this.mvcRegistrations != null && this.mvcRegistrations.getRequestMappingHandlerAdapter() != null) {
|
||||
return this.mvcRegistrations.getRequestMappingHandlerAdapter();
|
||||
if (this.mvcRegistrations != null) {
|
||||
RequestMappingHandlerAdapter adapter = this.mvcRegistrations.getRequestMappingHandlerAdapter();
|
||||
if (adapter != null) {
|
||||
return adapter;
|
||||
}
|
||||
}
|
||||
return super.createRequestMappingHandlerAdapter();
|
||||
}
|
||||
|
|
@ -470,8 +473,11 @@ public class WebMvcAutoConfiguration {
|
|||
|
||||
@Override
|
||||
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
|
||||
if (this.mvcRegistrations != null && this.mvcRegistrations.getRequestMappingHandlerMapping() != null) {
|
||||
return this.mvcRegistrations.getRequestMappingHandlerMapping();
|
||||
if (this.mvcRegistrations != null) {
|
||||
RequestMappingHandlerMapping mapping = this.mvcRegistrations.getRequestMappingHandlerMapping();
|
||||
if (mapping != null) {
|
||||
return mapping;
|
||||
}
|
||||
}
|
||||
return super.createRequestMappingHandlerMapping();
|
||||
}
|
||||
|
|
@ -489,8 +495,11 @@ public class WebMvcAutoConfiguration {
|
|||
|
||||
@Override
|
||||
protected ExceptionHandlerExceptionResolver createExceptionHandlerExceptionResolver() {
|
||||
if (this.mvcRegistrations != null && this.mvcRegistrations.getExceptionHandlerExceptionResolver() != null) {
|
||||
return this.mvcRegistrations.getExceptionHandlerExceptionResolver();
|
||||
if (this.mvcRegistrations != null) {
|
||||
ExceptionHandlerExceptionResolver resolver = this.mvcRegistrations.getExceptionHandlerExceptionResolver();
|
||||
if (resolver != null) {
|
||||
return resolver;
|
||||
}
|
||||
}
|
||||
return super.createExceptionHandlerExceptionResolver();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue