Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2aac5c00
Commit
2aac5c00
authored
Nov 03, 2020
by
Michal Růžička
Committed by
Andy Wilkinson
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid repeated calls of WebFlux and MVC registrations' getters
See gh-23999
parent
f9ff39a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
WebFluxAutoConfiguration.java
.../autoconfigure/web/reactive/WebFluxAutoConfiguration.java
+10
-6
WebMvcAutoConfiguration.java
...ot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java
+15
-6
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration.java
View file @
2aac5c00
...
...
@@ -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
();
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java
View file @
2aac5c00
...
...
@@ -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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment