Skip to content

Commit 21c3623

Browse files
committed
Merge pull request #27801 from Drezir
* pr/27801: Polish formatting Polish ExceptionHandlerMethodResolver mapping Closes gh-27801
2 parents 782a94f + 61601de commit 21c3623

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,8 @@ protected ServletInvocableHandlerMethod getExceptionHandlerMethod(
476476
// Local exception handler methods on the controller class itself.
477477
// To be invoked through the proxy, even in case of an interface-based proxy.
478478
handlerType = handlerMethod.getBeanType();
479-
ExceptionHandlerMethodResolver resolver = this.exceptionHandlerCache.get(handlerType);
480-
if (resolver == null) {
481-
resolver = new ExceptionHandlerMethodResolver(handlerType);
482-
this.exceptionHandlerCache.put(handlerType, resolver);
483-
}
479+
ExceptionHandlerMethodResolver resolver = this.exceptionHandlerCache.computeIfAbsent(
480+
handlerType, ExceptionHandlerMethodResolver::new);
484481
Method method = resolver.resolveMethod(exception);
485482
if (method != null) {
486483
return new ServletInvocableHandlerMethod(handlerMethod.getBean(), method, this.applicationContext);

0 commit comments

Comments
 (0)