Core: findbugs

This commit is contained in:
str4d
2013-11-27 23:22:49 +00:00
parent a17b1b99c0
commit ed2feb3ff7
2 changed files with 3 additions and 2 deletions

View File

@ -121,6 +121,7 @@ public class I2PAppContext {
private final File _logDir;
private final File _appDir;
private volatile File _tmpDir;
private final Random _tmpDirRand = new Random();
// split up big lock on this to avoid deadlocks
private final Object _lock1 = new Object(), _lock2 = new Object(), _lock3 = new Object(), _lock4 = new Object(),
_lock5 = new Object(), _lock6 = new Object(), _lock7 = new Object(), _lock8 = new Object(),
@ -403,7 +404,7 @@ public class I2PAppContext {
String d = getProperty("i2p.dir.temp", System.getProperty("java.io.tmpdir"));
// our random() probably isn't warmed up yet
byte[] rand = new byte[6];
(new Random()).nextBytes(rand);
_tmpDirRand.nextBytes(rand);
String f = "i2p-" + Base64.encode(rand) + ".tmp";
_tmpDir = new SecureDirectory(d, f);
if (_tmpDir.exists()) {