sonatype/nexus — pull request #405 by mcculls (2012-05-22 21:57:09+00:00)
Title: Use SecurityConfigurationManager instead of peeking into SecurityConfigurationSource directly

[ cherry-picked from https://github.com/sonatype/nexus/pull/404 since it also applies to master ]

Using SecurityConfigurationManager is preferred because it caches the model instance and provides locking - otherwise we end up with two instances of the SecurityConfiguration model (one previously cached inside SecurityConfigurationManager and one cached in FileSecurityConfigurationSource from the load request).

Other possible solutions that would also solve this issue:

* Call SecurityConfigurationManager.clearCache() after peeking into SecurityConfigurationSource (messy)
* Call SecurityConfigurationSource.getConfiguration() first and only if it's null then call SecurityConfigurationSource.loadConfiguration()