There is a checkstyle warning about double-checked locking in method DynamicCombinedConfiguration.getCurrentConfig(). Indeed, the double-check locking idiom is used, however, there is a comment saying that this safe due to the usage of a ConcurrentMap.

This may be true, but I wonder whether it would be better to use the map's putIfAbsent() method and avoid synchronization. The worst thing that can happen is that on parallel access multiple CombinedConfiguration instances are created which can be passed immediately to the garbage collector.

Thoughts?

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to