findbugs core,client,crypto,data,stat,i2np

This commit is contained in:
zzz
2011-01-07 00:15:35 +00:00
parent 0129051063
commit 087c7b86de
15 changed files with 76 additions and 51 deletions

View File

@ -63,7 +63,7 @@ import net.i2p.util.SecureDirectory;
*/
public class I2PAppContext {
/** the context that components without explicit root are bound */
protected static I2PAppContext _globalAppContext;
protected static volatile I2PAppContext _globalAppContext;
private Properties _overrideProps;
@ -117,7 +117,8 @@ public class I2PAppContext {
*
*/
public static I2PAppContext getGlobalContext() {
// skip the global lock
// skip the global lock - _gAC must be volatile
// http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
I2PAppContext rv = _globalAppContext;
if (rv != null)
return rv;
@ -474,6 +475,9 @@ public class I2PAppContext {
* provided during the context construction, as well as the ones included in
* System.getProperties.
*
* WARNING - not overridden in RouterContext, doesn't contain router config settings,
* use getProperties() instead.
*
* @return set of Strings containing the names of defined system properties
*/
public Set getPropertyNames() {