forked from I2P_Developers/i2p.i2p
Core: findbugs
This commit is contained in:
@ -121,6 +121,7 @@ public class I2PAppContext {
|
|||||||
private final File _logDir;
|
private final File _logDir;
|
||||||
private final File _appDir;
|
private final File _appDir;
|
||||||
private volatile File _tmpDir;
|
private volatile File _tmpDir;
|
||||||
|
private final Random _tmpDirRand = new Random();
|
||||||
// split up big lock on this to avoid deadlocks
|
// split up big lock on this to avoid deadlocks
|
||||||
private final Object _lock1 = new Object(), _lock2 = new Object(), _lock3 = new Object(), _lock4 = new Object(),
|
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(),
|
_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"));
|
String d = getProperty("i2p.dir.temp", System.getProperty("java.io.tmpdir"));
|
||||||
// our random() probably isn't warmed up yet
|
// our random() probably isn't warmed up yet
|
||||||
byte[] rand = new byte[6];
|
byte[] rand = new byte[6];
|
||||||
(new Random()).nextBytes(rand);
|
_tmpDirRand.nextBytes(rand);
|
||||||
String f = "i2p-" + Base64.encode(rand) + ".tmp";
|
String f = "i2p-" + Base64.encode(rand) + ".tmp";
|
||||||
_tmpDir = new SecureDirectory(d, f);
|
_tmpDir = new SecureDirectory(d, f);
|
||||||
if (_tmpDir.exists()) {
|
if (_tmpDir.exists()) {
|
||||||
|
@ -113,7 +113,7 @@ public class Clock implements Timestamper.UpdateListener {
|
|||||||
/*
|
/*
|
||||||
* @return the current delta from System.currentTimeMillis() in milliseconds
|
* @return the current delta from System.currentTimeMillis() in milliseconds
|
||||||
*/
|
*/
|
||||||
public long getOffset() {
|
public synchronized long getOffset() {
|
||||||
return _offset;
|
return _offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user