forked from I2P_Developers/i2p.i2p
findbugs
This commit is contained in:
@@ -33,6 +33,7 @@ import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import net.i2p.util.RandomSource;
|
||||
|
||||
/**
|
||||
* This class represents a NTP message, as specified in RFC 2030. The message
|
||||
@@ -399,7 +400,7 @@ public class NtpMessage {
|
||||
// low order bits of the timestamp with a random, unbiased
|
||||
// bitstring, both to avoid systematic roundoff errors and as
|
||||
// a means of loop detection and replay detection.
|
||||
array[7+pointer] = (byte) (Math.random()*255.0);
|
||||
array[7+pointer] = (byte) (RandomSource.getInstance().nextInt());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -321,14 +321,16 @@ public class Timestamper implements Runnable {
|
||||
_context.getProperty(PROP_CONCURRING_SERVERS, DEFAULT_CONCURRING_SERVERS)));
|
||||
}
|
||||
|
||||
/****
|
||||
public static void main(String args[]) {
|
||||
System.setProperty(PROP_DISABLED, "false");
|
||||
System.setProperty(PROP_QUERY_FREQUENCY, "30000");
|
||||
I2PAppContext ctx = I2PAppContext.getGlobalContext();
|
||||
I2PAppContext.getGlobalContext();
|
||||
for (int i = 0; i < 5*60*1000; i += 61*1000) {
|
||||
try { Thread.sleep(61*1000); } catch (InterruptedException ie) {}
|
||||
}
|
||||
}
|
||||
****/
|
||||
|
||||
/**
|
||||
* Interface to receive update notifications for when we query the time
|
||||
|
||||
Reference in New Issue
Block a user