Findbugs all over

This commit is contained in:
zzz
2018-08-26 13:50:40 +00:00
parent db54edc36d
commit 1f92232253
17 changed files with 56 additions and 66 deletions

View File

@ -189,7 +189,7 @@ class Daemon {
Destination oldDest;
if (knownNames != null) {
oldDest = null;
isKnown = key != null ? knownNames.contains(key) : null;
isKnown = key != null ? knownNames.contains(key) : false;
} else {
oldDest = key != null ? router.lookup(key) : null;
isKnown = oldDest != null;
@ -803,7 +803,7 @@ class Daemon {
*/
public static void main(String[] args) {
Daemon daemon = new Daemon();
if (args != null && args.length > 0 && args[0].equals("test"))
if (args.length > 0 && args[0].equals("test"))
daemon.test(args);
else
daemon.run(args);
@ -823,11 +823,14 @@ class Daemon {
ctx.logManager().flush();
}
/**
* @param args may be null
*/
public void run(String[] args) {
_running = true;
String settingsLocation = "config.txt";
File homeFile;
if (args.length > 0) {
if (args != null && args.length > 0) {
homeFile = new SecureDirectory(args[0]);
if (!homeFile.isAbsolute())
homeFile = new SecureDirectory(I2PAppContext.getGlobalContext().getRouterDir(), args[0]);

View File

@ -590,12 +590,7 @@ public class BlockFile implements Closeable {
_isClosed = true;
metaIndex.close();
Set<String> oi = openIndices.keySet();
Iterator<String> i = oi.iterator();
Object k;
while(i.hasNext()) {
k = i.next();
BSkipList bsl = openIndices.get(k);
for (BSkipList bsl : openIndices.values()) {
bsl.close();
}