AspectJProxyFactory
traditionally uses double-checked locking for accessing singleton aspect instances, applying a full lock for creating a new aspect instance. The latter can be reduced to a segment lock in ConcurrentHashMap
through the use of computeIfAbsent
, which is sensible here since the mapping function is self-contained and does not delegate to an SPI.