Findbugs all over

This commit is contained in:
zzz
2015-07-12 14:02:55 +00:00
parent 631a0674ab
commit 914cc120ad
13 changed files with 119 additions and 53 deletions

View File

@@ -52,6 +52,8 @@ public class RouterKeyGenerator extends RoutingKeyGenerator {
public RouterKeyGenerator(I2PAppContext context) {
_log = context.logManager().getLog(RoutingKeyGenerator.class);
_context = context;
// make sure GMT is set, azi2phelper Vuze plugin is disabling static JVM TZ setting in Router.java
_fmt.setCalendar(_cal);
// ensure non-null mod data
generateDateBasedModData();
}
@@ -61,14 +63,10 @@ public class RouterKeyGenerator extends RoutingKeyGenerator {
private volatile long _nextMidnight;
private volatile long _lastChanged;
private final static Calendar _cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"));
private final Calendar _cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"));
private static final String FORMAT = "yyyyMMdd";
private static final int LENGTH = FORMAT.length();
private final static SimpleDateFormat _fmt = new SimpleDateFormat(FORMAT, Locale.US);
static {
// make sure GMT is set, azi2phelper Vuze plugin is disabling static JVM TZ setting in Router.java
_fmt.setCalendar(_cal);
}
private final SimpleDateFormat _fmt = new SimpleDateFormat(FORMAT, Locale.US);
/**
* The current (today's) mod data.

View File

@@ -113,7 +113,7 @@ class BloomFilterIVValidator implements IVValidator {
path = _context.getBaseDir().toString();
}
String msg =
"Configured for " + DataHelper.formatSize(KBps *1024) +
"Configured for " + DataHelper.formatSize(KBps *1024L) +
"Bps share bandwidth but only " +
DataHelper.formatSize(maxMemory) + "B available memory." +
" Recommend increasing wrapper.java.maxmemory in " +
@@ -121,7 +121,7 @@ class BloomFilterIVValidator implements IVValidator {
// getMaxMemory() returns significantly lower than wrapper config, so add 10%
" to at least " + (recMaxMem * 11 / 10 / (1024*1024)) + " (MB)" +
" if the actual share bandwidth exceeds " +
DataHelper.formatSize(threshKBps * 1024) + "Bps.";
DataHelper.formatSize(threshKBps * 1024L) + "Bps.";
System.out.println("WARN: " + msg);
_context.logManager().getLog(BloomFilterIVValidator.class).logAlways(Log.WARN, msg);
}