...
This compliant solution does not use Collections.synchronizedMap()
because locking on the (unsynchronized) map provides sufficient thread-safety for this application. The guideline CON02-J. Always Do not synchronize on the appropriate objectglobal constants enlists certain objects that should not be used for synchronization purposes, including any object returned by Collections.synchronizedMap()
.
...