Changeset ed2feb3


Ignore:
Timestamp:
Nov 27, 2013 11:22:49 PM (7 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
f112baa
Parents:
a17b1b9
Message:

Core: findbugs

Location:
core/java/src/net/i2p
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/I2PAppContext.java

    ra17b1b9 red2feb3  
    122122    private final File _appDir;
    123123    private volatile File _tmpDir;
     124    private final Random _tmpDirRand = new Random();
    124125    // split up big lock on this to avoid deadlocks
    125126    private final Object _lock1 = new Object(), _lock2 = new Object(), _lock3 = new Object(), _lock4 = new Object(),
     
    404405                // our random() probably isn't warmed up yet
    405406                byte[] rand = new byte[6];
    406                 (new Random()).nextBytes(rand);
     407                _tmpDirRand.nextBytes(rand);
    407408                String f = "i2p-" + Base64.encode(rand) + ".tmp";
    408409                _tmpDir = new SecureDirectory(d, f);
  • core/java/src/net/i2p/util/Clock.java

    ra17b1b9 red2feb3  
    114114     * @return the current delta from System.currentTimeMillis() in milliseconds
    115115     */
    116     public long getOffset() {
     116    public synchronized long getOffset() {
    117117        return _offset;
    118118    }
Note: See TracChangeset for help on using the changeset viewer.