spring-framework
spring-framework copied to clipboard
Remove unnecessary synchronization blocks on maps and refactor
trafficstars
Nice refactor. I have one question: why are the synchronizations not needed?
Because the map is already thread friendly.
Nice refactor. I have one question: why are the synchronizations not needed?
Because the map is already thread friendly.
Indeed the cacheMap is a ConcurrentHashMap and is thread safe.
Thanks but I'd rather keep the code as it is now, an in particular for anything that's not a straightforward object creation within the lambda bloc.