I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit ed2feb3f authored by str4d's avatar str4d
Browse files

Core: findbugs

parent a17b1b99
No related branches found
No related tags found
No related merge requests found
...@@ -121,6 +121,7 @@ public class I2PAppContext { ...@@ -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 { ...@@ -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 { ...@@ -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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment