Remove unnecessary sync block in ControllerMethodResolver
Closes gh-29208
This commit is contained in:
parent
0ccb64fe10
commit
641303baff
|
@ -372,17 +372,7 @@ class ControllerMethodResolver {
|
|||
*/
|
||||
public SessionAttributesHandler getSessionAttributesHandler(HandlerMethod handlerMethod) {
|
||||
Class<?> handlerType = handlerMethod.getBeanType();
|
||||
SessionAttributesHandler result = this.sessionAttributesHandlerCache.get(handlerType);
|
||||
if (result == null) {
|
||||
synchronized (this.sessionAttributesHandlerCache) {
|
||||
result = this.sessionAttributesHandlerCache.get(handlerType);
|
||||
if (result == null) {
|
||||
result = new SessionAttributesHandler(handlerType);
|
||||
this.sessionAttributesHandlerCache.put(handlerType, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return this.sessionAttributesHandlerCache.computeIfAbsent(handlerType, SessionAttributesHandler::new);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue